aboutsummaryrefslogtreecommitdiff
path: root/srcs/phpmyadmin/libraries/classes/Plugins/Transformations
diff options
context:
space:
mode:
Diffstat (limited to 'srcs/phpmyadmin/libraries/classes/Plugins/Transformations')
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/Bool2TextTransformationsPlugin.php69
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/CodeMirrorEditorTransformationPlugin.php75
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/DateFormatTransformationsPlugin.php158
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/DownloadTransformationsPlugin.php93
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php160
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/FormattedTransformationsPlugin.php65
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/HexTransformationsPlugin.php71
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ImageLinkTransformationsPlugin.php63
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ImageUploadTransformationsPlugin.php121
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/InlineTransformationsPlugin.php78
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/LongToIPv4TransformationsPlugin.php66
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/PreApPendTransformationsPlugin.php68
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/RegexValidationTransformationsPlugin.php74
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/SQLTransformationsPlugin.php62
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/SubstringTransformationsPlugin.php93
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextFileUploadTransformationsPlugin.php103
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextImageLinkTransformationsPlugin.php75
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextLinkTransformationsPlugin.php77
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Image_JPEG_Upload.php44
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_FileUpload.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_Iptobinary.php141
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_JsonEditor.php85
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_RegexValidation.php44
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_SqlEditor.php85
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_XmlEditor.php85
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Download.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Hex.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Inline.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Link.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_PNG_Inline.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Binarytoip.php97
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Bool2Text.php45
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Dateformat.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_External.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Formatted.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Imagelink.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php101
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php60
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php101
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/README4
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/TEMPLATE45
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/TEMPLATE_ABSTRACT73
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_Link.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_Longtoipv4.php43
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_PreApPend.php44
-rw-r--r--srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_Substring.php43
47 files changed, 0 insertions, 3227 deletions
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/Bool2TextTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/Bool2TextTransformationsPlugin.php
deleted file mode 100644
index 696aa64..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/Bool2TextTransformationsPlugin.php
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the Bool2Text transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Bool2Text
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all of the Bool2Text transformations plugins.
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Bool2Text
- */
-abstract class Bool2TextTransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Converts Boolean values to text (default \'T\' and \'F\').'
- . ' First option is for TRUE, second for FALSE. Nonzero=true.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- $cfg = $GLOBALS['cfg'];
- $options = $this->getOptions($options, $cfg['DefaultTransformations']['Bool2Text']);
-
- if ($buffer == '0') {
- return $options[1]; // return false label
- }
-
- return $options[0]; // or true one if nonzero
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "Bool2Text";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/CodeMirrorEditorTransformationPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/CodeMirrorEditorTransformationPlugin.php
deleted file mode 100644
index bbd1fff..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/CodeMirrorEditorTransformationPlugin.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for syntax highlighted editors using CodeMirror
- *
- * @package PhpMyAdmin-Transformations
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\IOTransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all the CodeMirror syntax highlighted editors
- *
- * @package PhpMyAdmin-Transformations
- */
-abstract class CodeMirrorEditorTransformationPlugin extends IOTransformationsPlugin
-{
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- return $buffer;
- }
-
- /**
- * Returns the html for input field to override default textarea.
- * Note: Return empty string if default textarea is required.
- *
- * @param array $column column details
- * @param int $row_id row number
- * @param string $column_name_appendix the name attribute
- * @param array $options transformation options
- * @param string $value Current field value
- * @param string $text_dir text direction
- * @param int $tabindex tab index
- * @param int $tabindex_for_value offset for the values tabindex
- * @param int $idindex id index
- *
- * @return string the html for input field
- */
- public function getInputHtml(
- array $column,
- $row_id,
- $column_name_appendix,
- array $options,
- $value,
- $text_dir,
- $tabindex,
- $tabindex_for_value,
- $idindex
- ) {
- $html = '';
- if (! empty($value)) {
- $html = '<input type="hidden" name="fields_prev' . $column_name_appendix
- . '" value="' . htmlspecialchars($value) . '">';
- }
- $class = 'transform_' . strtolower(static::getName()) . '_editor';
- $html .= '<textarea name="fields' . $column_name_appendix . '"'
- . ' dir="' . $text_dir . '" class="' . $class . '">'
- . htmlspecialchars($value) . '</textarea>';
-
- return $html;
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/DateFormatTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/DateFormatTransformationsPlugin.php
deleted file mode 100644
index 32ed494..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/DateFormatTransformationsPlugin.php
+++ /dev/null
@@ -1,158 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the date format transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage DateFormat
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use PhpMyAdmin\Sanitize;
-use PhpMyAdmin\Util;
-use stdClass;
-
-/**
- * Provides common methods for all of the date format transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class DateFormatTransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Displays a TIME, TIMESTAMP, DATETIME or numeric unix timestamp'
- . ' column as formatted date. The first option is the offset (in'
- . ' hours) which will be added to the timestamp (Default: 0). Use'
- . ' second option to specify a different date/time format string.'
- . ' Third option determines whether you want to see local date or'
- . ' UTC one (use "local" or "utc" strings) for that. According to'
- . ' that, date format has different value - for "local" see the'
- . ' documentation for PHP\'s strftime() function and for "utc" it'
- . ' is done using gmdate() function.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- $buffer = (string) $buffer;
- // possibly use a global transform and feed it with special options
- $cfg = $GLOBALS['cfg'];
- $options = $this->getOptions($options, $cfg['DefaultTransformations']['DateFormat']);
-
- // further operations on $buffer using the $options[] array.
- $options[2] = mb_strtolower($options[2]);
-
- if (empty($options[1])) {
- if ($options[2] == 'local') {
- $options[1] = __('%B %d, %Y at %I:%M %p');
- } else {
- $options[1] = 'Y-m-d H:i:s';
- }
- }
-
- $timestamp = -1;
-
- // INT columns will be treated as UNIX timestamps
- // and need to be detected before the verification for
- // MySQL TIMESTAMP
- if ($meta->type == 'int') {
- $timestamp = $buffer;
-
- // Detect TIMESTAMP(6 | 8 | 10 | 12 | 14)
- // TIMESTAMP (2 | 4) not supported here.
- // (Note: prior to MySQL 4.1, TIMESTAMP has a display size
- // for example TIMESTAMP(8) means YYYYMMDD)
- } else {
- if (preg_match('/^(\d{2}){3,7}$/', $buffer)) {
- if (mb_strlen($buffer) == 14 || mb_strlen($buffer) == 8) {
- $offset = 4;
- } else {
- $offset = 2;
- }
-
- $aDate = [];
- $aDate['year'] = (int) mb_substr($buffer, 0, $offset);
- $aDate['month'] = (int) mb_substr($buffer, $offset, 2);
- $aDate['day'] = (int) mb_substr($buffer, $offset + 2, 2);
- $aDate['hour'] = (int) mb_substr($buffer, $offset + 4, 2);
- $aDate['minute'] = (int) mb_substr($buffer, $offset + 6, 2);
- $aDate['second'] = (int) mb_substr($buffer, $offset + 8, 2);
-
- if (checkdate($aDate['month'], $aDate['day'], $aDate['year'])) {
- $timestamp = mktime(
- $aDate['hour'],
- $aDate['minute'],
- $aDate['second'],
- $aDate['month'],
- $aDate['day'],
- $aDate['year']
- );
- }
- // If all fails, assume one of the dozens of valid strtime() syntaxes
- // (https://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html)
- } else {
- if (preg_match('/^[0-9]\d{1,9}$/', $buffer)) {
- $timestamp = (int) $buffer;
- } else {
- $timestamp = strtotime($buffer);
- }
- }
- }
-
- // If all above failed, maybe it's a Unix timestamp already?
- if ($timestamp < 0 && preg_match('/^[1-9]\d{1,9}$/', $buffer)) {
- $timestamp = $buffer;
- }
-
- // Reformat a valid timestamp
- if ($timestamp >= 0) {
- $timestamp -= (int) $options[0] * 60 * 60;
- $source = $buffer;
- if ($options[2] == 'local') {
- $text = Util::localisedDate(
- $timestamp,
- $options[1]
- );
- } elseif ($options[2] == 'utc') {
- $text = gmdate($options[1], $timestamp);
- } else {
- $text = 'INVALID DATE TYPE';
- }
- return '<dfn onclick="alert(\'' . Sanitize::jsFormat($source, false) . '\');" title="'
- . htmlspecialchars((string) $source) . '">' . htmlspecialchars((string) $text) . '</dfn>';
- }
-
- return htmlspecialchars((string) $buffer);
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "Date Format";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/DownloadTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/DownloadTransformationsPlugin.php
deleted file mode 100644
index d6c21d6..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/DownloadTransformationsPlugin.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the download transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Download
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all of the download transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class DownloadTransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Displays a link to download the binary data of the column. You can'
- . ' use the first option to specify the filename, or use the second'
- . ' option as the name of a column which contains the filename. If'
- . ' you use the second option, you need to set the first option to'
- . ' the empty string.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- global $row, $fields_meta;
-
- if (isset($options[0]) && ! empty($options[0])) {
- $cn = $options[0]; // filename
- } else {
- if (isset($options[1]) && ! empty($options[1])) {
- foreach ($fields_meta as $key => $val) {
- if ($val->name == $options[1]) {
- $pos = $key;
- break;
- }
- }
- if (isset($pos)) {
- $cn = $row[$pos];
- }
- }
- if (empty($cn)) {
- $cn = 'binary_file.dat';
- }
- }
-
- return sprintf(
- '<a href="transformation_wrapper.php%s&amp;ct=application'
- . '/octet-stream&amp;cn=%s" title="%s" class="disableAjax">%s</a>',
- $options['wrapper_link'],
- htmlspecialchars(urlencode($cn)),
- htmlspecialchars($cn),
- htmlspecialchars($cn)
- );
- }
-
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "Download";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php
deleted file mode 100644
index 006ee86..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php
+++ /dev/null
@@ -1,160 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the external transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage External
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all of the external transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class ExternalTransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'LINUX ONLY: Launches an external application and feeds it the column'
- . ' data via standard input. Returns the standard output of the'
- . ' application. The default is Tidy, to pretty-print HTML code.'
- . ' For security reasons, you have to manually edit the file'
- . ' libraries/classes/Plugins/Transformations/Output/Text_Plain_External'
- . '.php and list the tools you want to make available.'
- . ' The first option is then the number of the program you want to'
- . ' use and the second option is the parameters for the program.'
- . ' The third option, if set to 1, will convert the output using'
- . ' htmlspecialchars() (Default 1). The fourth option, if set to 1,'
- . ' will prevent wrapping and ensure that the output appears all on'
- . ' one line (Default 1).'
- );
- }
-
- /**
- * Enables no-wrapping
- *
- * @param array $options transformation options
- *
- * @return bool
- */
- public function applyTransformationNoWrap(array $options = [])
- {
- if (! isset($options[3]) || $options[3] == '') {
- $nowrap = true;
- } elseif ($options[3] == '1' || $options[3] == 1) {
- $nowrap = true;
- } else {
- $nowrap = false;
- }
-
- return $nowrap;
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- // possibly use a global transform and feed it with special options
-
- // further operations on $buffer using the $options[] array.
-
- $allowed_programs = [];
-
- //
- // WARNING:
- //
- // It's up to administrator to allow anything here. Note that users may
- // specify any parameters, so when programs allow output redirection or
- // any other possibly dangerous operations, you should write wrapper
- // script that will publish only functions you really want.
- //
- // Add here program definitions like (note that these are NOT safe
- // programs):
- //
- //$allowed_programs[0] = '/usr/local/bin/tidy';
- //$allowed_programs[1] = '/usr/local/bin/validate';
-
- // no-op when no allowed programs
- if (count($allowed_programs) === 0) {
- return $buffer;
- }
-
- $cfg = $GLOBALS['cfg'];
- $options = $this->getOptions(
- $options,
- $cfg['DefaultTransformations']['External']
- );
-
- if (isset($allowed_programs[$options[0]])) {
- $program = $allowed_programs[$options[0]];
- } else {
- $program = $allowed_programs[0];
- }
-
- // needs PHP >= 4.3.0
- $newstring = '';
- $descriptorspec = [
- 0 => [
- "pipe",
- "r",
- ],
- 1 => [
- "pipe",
- "w",
- ],
- ];
- $process = proc_open($program . ' ' . $options[1], $descriptorspec, $pipes);
- if (is_resource($process)) {
- fwrite($pipes[0], $buffer);
- fclose($pipes[0]);
-
- while (! feof($pipes[1])) {
- $newstring .= fgets($pipes[1], 1024);
- }
- fclose($pipes[1]);
- // we don't currently use the return value
- proc_close($process);
- }
-
- if ($options[2] == 1 || $options[2] == '2') {
- $retstring = htmlspecialchars($newstring);
- } else {
- $retstring = $newstring;
- }
-
- return $retstring;
- }
-
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "External";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/FormattedTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/FormattedTransformationsPlugin.php
deleted file mode 100644
index b40ffe3..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/FormattedTransformationsPlugin.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the formatted transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Formatted
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all of the formatted transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class FormattedTransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Displays the contents of the column as-is, without running it'
- . ' through htmlspecialchars(). That is, the column is assumed'
- . ' to contain valid HTML.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- return '<iframe srcdoc="'
- . strtr($buffer, '"', '\'')
- . '" sandbox=""></iframe>';
- }
-
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "Formatted";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/HexTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/HexTransformationsPlugin.php
deleted file mode 100644
index 69ce92d..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/HexTransformationsPlugin.php
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the hex transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Hex
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all of the hex transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class HexTransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Displays hexadecimal representation of data. Optional first'
- . ' parameter specifies how often space will be added (defaults'
- . ' to 2 nibbles).'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- // possibly use a global transform and feed it with special options
- $cfg = $GLOBALS['cfg'];
- $options = $this->getOptions($options, $cfg['DefaultTransformations']['Hex']);
- $options[0] = intval($options[0]);
-
- if ($options[0] < 1) {
- return bin2hex($buffer);
- } else {
- return chunk_split(bin2hex($buffer), $options[0], ' ');
- }
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "Hex";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ImageLinkTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ImageLinkTransformationsPlugin.php
deleted file mode 100644
index efcfdc5..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ImageLinkTransformationsPlugin.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the link transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Link
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all of the link transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class ImageLinkTransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Displays a link to download this image.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- // must disable the page loader, see
- // https://wiki.phpmyadmin.net/pma/Page_loader#Bypassing_the_page_loader
- return '<a class="disableAjax" target="_blank" rel="noopener noreferrer" href="transformation_wrapper.php'
- . $options['wrapper_link'] . '" alt="[' . htmlspecialchars($buffer) . ']">[BLOB]</a>';
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "ImageLink";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ImageUploadTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ImageUploadTransformationsPlugin.php
deleted file mode 100644
index 0e6c0fd..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ImageUploadTransformationsPlugin.php
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the image upload input transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage ImageUpload
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\IOTransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all of the image upload transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class ImageUploadTransformationsPlugin extends IOTransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Image upload functionality which also displays a thumbnail.'
- . ' The options are the width and height of the thumbnail'
- . ' in pixels. Defaults to 100 X 100.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- return $buffer;
- }
-
- /**
- * Returns the html for input field to override default textarea.
- * Note: Return empty string if default textarea is required.
- *
- * @param array $column column details
- * @param int $row_id row number
- * @param string $column_name_appendix the name attribute
- * @param array $options transformation options
- * @param string $value Current field value
- * @param string $text_dir text direction
- * @param int $tabindex tab index
- * @param int $tabindex_for_value offset for the values tabindex
- * @param int $idindex id index
- *
- * @return string the html for input field
- */
- public function getInputHtml(
- array $column,
- $row_id,
- $column_name_appendix,
- array $options,
- $value,
- $text_dir,
- $tabindex,
- $tabindex_for_value,
- $idindex
- ) {
- $html = '';
- $src = '';
- if (! empty($value)) {
- $html = '<input type="hidden" name="fields_prev' . $column_name_appendix
- . '" value="' . bin2hex($value) . '">';
- $html .= '<input type="hidden" name="fields' . $column_name_appendix
- . '" value="' . bin2hex($value) . '">';
- $src = 'transformation_wrapper.php' . $options['wrapper_link'];
- }
- $html .= '<img src="' . $src . '" width="'
- . (isset($options[0]) ? intval($options[0]) : '100') . '" height="'
- . (isset($options[1]) ? intval($options[1]) : '100') . '" alt="'
- . __('Image preview here') . '">';
- $html .= '<br><input type="file" name="fields_upload'
- . $column_name_appendix . '" accept="image/*" class="image-upload">';
-
- return $html;
- }
-
- /**
- * Returns the array of scripts (filename) required for plugin
- * initialization and handling
- *
- * @return array javascripts to be included
- */
- public function getScripts()
- {
- return [
- 'transformations/image_upload.js',
- ];
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "Image upload";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/InlineTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/InlineTransformationsPlugin.php
deleted file mode 100644
index 102dce9..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/InlineTransformationsPlugin.php
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the inline transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Inline
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all of the inline transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class InlineTransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Displays a clickable thumbnail. The options are the maximum width'
- . ' and height in pixels. The original aspect ratio is preserved.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- $cfg = $GLOBALS['cfg'];
- $options = $this->getOptions($options, $cfg['DefaultTransformations']['Inline']);
-
- if (PMA_IS_GD2) {
- return '<a href="transformation_wrapper.php'
- . $options['wrapper_link']
- . '" rel="noopener noreferrer" target="_blank"><img src="transformation_wrapper.php'
- . $options['wrapper_link'] . '&amp;resize=jpeg&amp;newWidth='
- . intval($options[0]) . '&amp;newHeight='
- . intval($options[1])
- . '" alt="[' . htmlspecialchars($buffer) . ']" border="0"></a>';
- } else {
- return '<img src="transformation_wrapper.php'
- . $options['wrapper_link']
- . '" alt="[' . htmlspecialchars($buffer) . ']" width="320" height="240">';
- }
- }
-
-
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "Inline";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/LongToIPv4TransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/LongToIPv4TransformationsPlugin.php
deleted file mode 100644
index 03767dc..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/LongToIPv4TransformationsPlugin.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the long to IPv4 transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage LongToIPv4
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use PhpMyAdmin\Util;
-use stdClass;
-
-/**
- * Provides common methods for all of the long to IPv4 transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class LongToIPv4TransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Converts an (IPv4) Internet network address stored as a BIGINT'
- . ' into a string in Internet standard dotted format.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- if (! Util::isInteger($buffer) || $buffer < 0 || $buffer > 4294967295) {
- return htmlspecialchars($buffer);
- }
-
- return long2ip((int) $buffer);
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "Long To IPv4";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/PreApPendTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/PreApPendTransformationsPlugin.php
deleted file mode 100644
index 3dbf9d8..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/PreApPendTransformationsPlugin.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the prepend/append transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage PreApPend
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all of the prepend/append transformations plugins.
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage PreApPend
- */
-abstract class PreApPendTransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Prepends and/or Appends text to a string. First option is text'
- . ' to be prepended, second is appended (enclosed in single'
- . ' quotes, default empty string).'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- $cfg = $GLOBALS['cfg'];
- $options = $this->getOptions($options, $cfg['DefaultTransformations']['PreApPend']);
-
- //just prepend and/or append the options to the original text
- return htmlspecialchars($options[0]) . htmlspecialchars($buffer)
- . htmlspecialchars($options[1]);
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "PreApPend";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/RegexValidationTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/RegexValidationTransformationsPlugin.php
deleted file mode 100644
index 33f0ccd..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/RegexValidationTransformationsPlugin.php
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the regex validation input transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage RegexValidation
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\IOTransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all of the regex validation
- * input transformations plugins.
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage RegexValidation
- */
-abstract class RegexValidationTransformationsPlugin extends IOTransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Validates the string using regular expression '
- . 'and performs insert only if string matches it. '
- . 'The first option is the Regular Expression.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- // reset properties of object
- $this->reset();
- if (! empty($options[0]) && ! preg_match($options[0], $buffer)) {
- $this->success = false;
- $this->error = sprintf(
- __('Validation failed for the input string %s.'),
- htmlspecialchars($buffer)
- );
- }
-
- return $buffer;
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "Regex Validation";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/SQLTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/SQLTransformationsPlugin.php
deleted file mode 100644
index 616a24e..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/SQLTransformationsPlugin.php
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the SQL transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage SQL
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use PhpMyAdmin\Util;
-use stdClass;
-
-/**
- * Provides common methods for all of the SQL transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class SQLTransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Formats text as SQL query with syntax highlighting.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- return Util::formatSql($buffer);
- }
-
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "SQL";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/SubstringTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/SubstringTransformationsPlugin.php
deleted file mode 100644
index 7267f6c..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/SubstringTransformationsPlugin.php
+++ /dev/null
@@ -1,93 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the substring transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Substring
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all of the substring transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class SubstringTransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Displays a part of a string. The first option is the number of'
- . ' characters to skip from the beginning of the string (Default 0).'
- . ' The second option is the number of characters to return (Default:'
- . ' until end of string). The third option is the string to append'
- . ' and/or prepend when truncation occurs (Default: "…").'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- // possibly use a global transform and feed it with special options
-
- // further operations on $buffer using the $options[] array.
- $cfg = $GLOBALS['cfg'];
- $options = $this->getOptions($options, $cfg['DefaultTransformations']['Substring']);
-
- if ($options[1] != 'all') {
- $newtext = mb_substr(
- $buffer,
- $options[0],
- $options[1]
- );
- } else {
- $newtext = mb_substr($buffer, $options[0]);
- }
-
- $length = mb_strlen($newtext);
- $baselength = mb_strlen($buffer);
- if ($length != $baselength) {
- if ($options[0] != 0) {
- $newtext = $options[2] . $newtext;
- }
-
- if (($length + (int) $options[0]) != $baselength) {
- $newtext .= $options[2];
- }
- }
-
- return htmlspecialchars($newtext);
- }
-
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "Substring";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextFileUploadTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextFileUploadTransformationsPlugin.php
deleted file mode 100644
index 76021d8..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextFileUploadTransformationsPlugin.php
+++ /dev/null
@@ -1,103 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the text file upload input transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage TextFileUpload
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\IOTransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all of the text file upload
- * input transformations plugins.
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage TextFileUpload
- */
-abstract class TextFileUploadTransformationsPlugin extends IOTransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'File upload functionality for TEXT columns. '
- . 'It does not have a textarea for input.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- return $buffer;
- }
-
- /**
- * Returns the html for input field to override default textarea.
- * Note: Return empty string if default textarea is required.
- *
- * @param array $column column details
- * @param int $row_id row number
- * @param string $column_name_appendix the name attribute
- * @param array $options transformation options
- * @param string $value Current field value
- * @param string $text_dir text direction
- * @param int $tabindex tab index
- * @param int $tabindex_for_value offset for the values tabindex
- * @param int $idindex id index
- *
- * @return string the html for input field
- */
- public function getInputHtml(
- array $column,
- $row_id,
- $column_name_appendix,
- array $options,
- $value,
- $text_dir,
- $tabindex,
- $tabindex_for_value,
- $idindex
- ) {
- $html = '';
- if (! empty($value)) {
- $html = '<input type="hidden" name="fields_prev' . $column_name_appendix
- . '" value="' . htmlspecialchars($value) . '">';
- $html .= '<input type="hidden" name="fields' . $column_name_appendix
- . '" value="' . htmlspecialchars($value) . '">';
- }
- $html .= '<input type="file" name="fields_upload'
- . $column_name_appendix . '">';
-
- return $html;
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "Text file upload";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextImageLinkTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextImageLinkTransformationsPlugin.php
deleted file mode 100644
index 71fdd6a..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextImageLinkTransformationsPlugin.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the image link transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage ImageLink
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use PhpMyAdmin\Sanitize;
-use stdClass;
-
-/**
- * Provides common methods for all of the image link transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class TextImageLinkTransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Displays an image and a link; the column contains the filename. The'
- . ' first option is a URL prefix like "https://www.example.com/". The'
- . ' second and third options are the width and the height in pixels.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- $cfg = $GLOBALS['cfg'];
- $options = $this->getOptions($options, $cfg['DefaultTransformations']['TextImageLink']);
- $url = $options[0] . $buffer;
- /* Do not allow javascript links */
- if (! Sanitize::checkLink($url, true, true)) {
- return htmlspecialchars($url);
- }
- return '<a href="' . htmlspecialchars($url)
- . '" rel="noopener noreferrer" target="_blank"><img src="' . htmlspecialchars($url)
- . '" border="0" width="' . intval($options[1])
- . '" height="' . intval($options[2]) . '">'
- . htmlspecialchars($buffer) . '</a>';
- }
-
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "Image Link";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextLinkTransformationsPlugin.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextLinkTransformationsPlugin.php
deleted file mode 100644
index e29ff2c..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextLinkTransformationsPlugin.php
+++ /dev/null
@@ -1,77 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Abstract class for the link transformations plugins
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Link
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use PhpMyAdmin\Sanitize;
-use stdClass;
-
-/**
- * Provides common methods for all of the link transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class TextLinkTransformationsPlugin extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Displays a link; the column contains the filename. The first option'
- . ' is a URL prefix like "https://www.example.com/". The second option'
- . ' is a title for the link.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- $cfg = $GLOBALS['cfg'];
- $options = $this->getOptions($options, $cfg['DefaultTransformations']['TextLink']);
- $url = (isset($options[0]) ? $options[0] : '') . ((isset($options[2]) && $options[2]) ? '' : $buffer);
- /* Do not allow javascript links */
- if (! Sanitize::checkLink($url, true, true)) {
- return htmlspecialchars($url);
- }
- return '<a href="'
- . htmlspecialchars($url)
- . '" title="'
- . htmlspecialchars(isset($options[1]) ? $options[1] : '')
- . '" target="_blank" rel="noopener noreferrer">'
- . htmlspecialchars(isset($options[1]) ? $options[1] : $buffer)
- . '</a>';
- }
-
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "TextLink";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Image_JPEG_Upload.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Image_JPEG_Upload.php
deleted file mode 100644
index 903bfd2..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Image_JPEG_Upload.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Image JPEG Upload Input Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage ImageUpload
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Input;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\ImageUploadTransformationsPlugin;
-
-/**
- * Handles the image upload input transformation for JPEG.
- * Has two option: width & height of the thumbnail
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage ImageUpload
- */
-// @codingStandardsIgnoreLine
-class Image_JPEG_Upload extends ImageUploadTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Image";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "JPEG";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_FileUpload.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_FileUpload.php
deleted file mode 100644
index b7a2ae3..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_FileUpload.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain File Upload Input Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage TextFileUpload
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Input;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\TextFileUploadTransformationsPlugin;
-
-/**
- * Handles the input text file upload transformation for text plain.
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage TextFileUpload
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_FileUpload extends TextFileUploadTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_Iptobinary.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_Iptobinary.php
deleted file mode 100644
index b504cac..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_Iptobinary.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Handles the IPv4/IPv6 to binary transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage IPToBinary
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Input;
-
-use PhpMyAdmin\Plugins\IOTransformationsPlugin;
-use stdClass;
-
-/**
- * Handles the IPv4/IPv6 to binary transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage IPToBinary
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_Iptobinary extends IOTransformationsPlugin
-{
- /**
- * Gets the transformation description of the plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Converts an Internet network address in (IPv4/IPv6) format to binary'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed. a binary string containing
- * an IP address, as returned from MySQL's INET6_ATON
- * function
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string IP address
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- $val = @inet_pton($buffer);
- if ($val !== false) {
- return '0x' . bin2hex($val);
- }
-
- return $buffer;
- }
-
- /**
- * Returns the html for input field to override default textarea.
- * Note: Return empty string if default textarea is required.
- *
- * @param array $column column details
- * @param int $row_id row number
- * @param string $column_name_appendix the name attribute
- * @param array $options transformation options
- * @param string $value Current field value
- * @param string $text_dir text direction
- * @param int $tabindex tab index
- * @param int $tabindex_for_value offset for the values tabindex
- * @param int $idindex id index
- *
- * @return string the html for input field
- */
- public function getInputHtml(
- array $column,
- $row_id,
- $column_name_appendix,
- array $options,
- $value,
- $text_dir,
- $tabindex,
- $tabindex_for_value,
- $idindex
- ) {
- $html = '';
- $val = '';
- if (! empty($value)) {
- $length = strlen($value);
- if ($length == 4 || $length == 16) {
- $ip = @inet_ntop(pack('A' . $length, $value));
- if ($ip !== false) {
- $val = $ip;
- }
- }
- $html = '<input type="hidden" name="fields_prev' . $column_name_appendix
- . '" value="' . htmlspecialchars($val) . '">';
- }
- $class = 'transform_IPToBin';
- $html .= '<input type="text" name="fields' . $column_name_appendix . '"'
- . ' value="' . htmlspecialchars($val) . '"'
- . ' size="40"'
- . ' dir="' . $text_dir . '"'
- . ' class="' . $class . '"'
- . ' id="field_' . $idindex . '_3"'
- . ' tabindex="' . ($tabindex + $tabindex_for_value) . '">';
-
- return $html;
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "IPv4/IPv6 To Binary";
- }
-
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_JsonEditor.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_JsonEditor.php
deleted file mode 100644
index 17d8cf6..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_JsonEditor.php
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * JSON editing with syntax highlighted CodeMirror editor
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage JSON
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Input;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\CodeMirrorEditorTransformationPlugin;
-
-/**
- * JSON editing with syntax highlighted CodeMirror editor
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage JSON
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_JsonEditor extends CodeMirrorEditorTransformationPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Syntax highlighted CodeMirror editor for JSON.'
- );
- }
-
- /**
- * Returns the array of scripts (filename) required for plugin
- * initialization and handling
- *
- * @return array javascripts to be included
- */
- public function getScripts()
- {
- $scripts = [];
- if ($GLOBALS['cfg']['CodemirrorEnable']) {
- $scripts[] = 'vendor/codemirror/lib/codemirror.js';
- $scripts[] = 'vendor/codemirror/mode/javascript/javascript.js';
- $scripts[] = 'transformations/json_editor.js';
- }
-
- return $scripts;
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "JSON";
- }
-
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_RegexValidation.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_RegexValidation.php
deleted file mode 100644
index 136fe62..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_RegexValidation.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain Regex Validation Input Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage RegexValidation
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Input;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\RegexValidationTransformationsPlugin;
-
-/**
- * Handles the input regex validation transformation for text plain.
- * Has one option: the regular expression
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage RegexValidation
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_RegexValidation extends RegexValidationTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_SqlEditor.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_SqlEditor.php
deleted file mode 100644
index 478b21c..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_SqlEditor.php
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * SQL editing with syntax highlighted CodeMirror editor
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage SQL
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Input;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\CodeMirrorEditorTransformationPlugin;
-
-/**
- * SQL editing with syntax highlighted CodeMirror editor
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage SQL
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_SqlEditor extends CodeMirrorEditorTransformationPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Syntax highlighted CodeMirror editor for SQL.'
- );
- }
-
- /**
- * Returns the array of scripts (filename) required for plugin
- * initialization and handling
- *
- * @return array javascripts to be included
- */
- public function getScripts()
- {
- $scripts = [];
- if ($GLOBALS['cfg']['CodemirrorEnable']) {
- $scripts[] = 'vendor/codemirror/lib/codemirror.js';
- $scripts[] = 'vendor/codemirror/mode/sql/sql.js';
- $scripts[] = 'transformations/sql_editor.js';
- }
-
- return $scripts;
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "SQL";
- }
-
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_XmlEditor.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_XmlEditor.php
deleted file mode 100644
index 0c4e492..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_XmlEditor.php
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * XML (and HTML) editing with syntax highlighted CodeMirror editor
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage XML
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Input;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\CodeMirrorEditorTransformationPlugin;
-
-/**
- * XML (and HTML) editing with syntax highlighted CodeMirror editor
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage XML
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_XmlEditor extends CodeMirrorEditorTransformationPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Syntax highlighted CodeMirror editor for XML (and HTML).'
- );
- }
-
- /**
- * Returns the array of scripts (filename) required for plugin
- * initialization and handling
- *
- * @return array javascripts to be included
- */
- public function getScripts()
- {
- $scripts = [];
- if ($GLOBALS['cfg']['CodemirrorEnable']) {
- $scripts[] = 'vendor/codemirror/lib/codemirror.js';
- $scripts[] = 'vendor/codemirror/mode/xml/xml.js';
- $scripts[] = 'transformations/xml_editor.js';
- }
-
- return $scripts;
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "XML";
- }
-
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Download.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Download.php
deleted file mode 100644
index 2c0795f..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Download.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Application OctetStream Download Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Download
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\DownloadTransformationsPlugin;
-
-/**
- * Handles the download transformation for application octetstream
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Download
- */
-// @codingStandardsIgnoreLine
-class Application_Octetstream_Download extends DownloadTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Application";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "OctetStream";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Hex.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Hex.php
deleted file mode 100644
index 4ab62eb..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Application_Octetstream_Hex.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Application OctetStream Hex Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Hex
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\HexTransformationsPlugin;
-
-/**
- * Handles the hex transformation for application octetstream
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Hex
- */
-// @codingStandardsIgnoreLine
-class Application_Octetstream_Hex extends HexTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Application";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "OctetStream";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Inline.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Inline.php
deleted file mode 100644
index 7c69405..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Inline.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Image JPEG Inline Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Inline
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\InlineTransformationsPlugin;
-
-/**
- * Handles the inline transformation for image jpeg
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Inline
- */
-// @codingStandardsIgnoreLine
-class Image_JPEG_Inline extends InlineTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Image";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "JPEG";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Link.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Link.php
deleted file mode 100644
index f338d57..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_JPEG_Link.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Image JPEG Link Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Link
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\ImageLinkTransformationsPlugin;
-
-/**
- * Handles the link transformation for image jpeg
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Link
- */
-// @codingStandardsIgnoreLine
-class Image_JPEG_Link extends ImageLinkTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Image";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "JPEG";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_PNG_Inline.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_PNG_Inline.php
deleted file mode 100644
index 5c8e5e5..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Image_PNG_Inline.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Image PNG Inline Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Inline
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\InlineTransformationsPlugin;
-
-/**
- * Handles the inline transformation for image png
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Inline
- */
-// @codingStandardsIgnoreLine
-class Image_PNG_Inline extends InlineTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Image";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "PNG";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php
deleted file mode 100644
index e6132f0..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Blob SQL Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage SQL
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\SQLTransformationsPlugin;
-
-/**
- * Handles the sql transformation for blob data
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage SQL
- */
-// @codingStandardsIgnoreLine
-class Text_Octetstream_Sql extends SQLTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Octetstream";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Binarytoip.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Binarytoip.php
deleted file mode 100644
index ea08c78..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Binarytoip.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Handles the binary to IPv4/IPv6 transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage BinaryToIP
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use stdClass;
-
-/**
- * Handles the binary to IPv4/IPv6 transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage BinaryToIP
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_Binarytoip extends TransformationsPlugin
-{
- /**
- * Gets the transformation description of the plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Converts an Internet network address stored as a binary string'
- . ' into a string in Internet standard (IPv4/IPv6) format.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed. a binary string containing
- * an IP address, as returned from MySQL's INET6_ATON
- * function
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string IP address
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- if (0 !== strpos($buffer, '0x')) {
- return $buffer;
- }
-
- $ipHex = substr($buffer, 2);
- $ipBin = hex2bin($ipHex);
-
- if (false === $ipBin) {
- return $buffer;
- }
-
- return @inet_ntop($ipBin);
- }
-
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the transformation name of the plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "Binary To IPv4/IPv6";
- }
-
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Bool2Text.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Bool2Text.php
deleted file mode 100644
index fcb65a6..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Bool2Text.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain Bool2Text Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Bool2Text
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\Bool2TextTransformationsPlugin;
-
-/**
- * Handles the Boolean to Text transformation for text plain.
- * Has one option: the output format (default 'T/F')
- * or 'Y/N'
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Bool2Text
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_Bool2Text extends Bool2TextTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Dateformat.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Dateformat.php
deleted file mode 100644
index 1d0ae78..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Dateformat.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain Date Format Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage DateFormat
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\DateFormatTransformationsPlugin;
-
-/**
- * Handles the date format transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage DateFormat
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_Dateformat extends DateFormatTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_External.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_External.php
deleted file mode 100644
index 8e5a36d..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_External.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain External Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage External
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\ExternalTransformationsPlugin;
-
-/**
- * Handles the external transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage External
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_External extends ExternalTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Formatted.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Formatted.php
deleted file mode 100644
index 6eeffba..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Formatted.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain Formatted Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Formatted
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\FormattedTransformationsPlugin;
-
-/**
- * Handles the formatted transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Formatted
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_Formatted extends FormattedTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Imagelink.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Imagelink.php
deleted file mode 100644
index fcad39b..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Imagelink.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain Image Link Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage ImageLink
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\TextImageLinkTransformationsPlugin;
-
-/**
- * Handles the image link transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage ImageLink
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_Imagelink extends TextImageLinkTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php
deleted file mode 100644
index ce06610..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain JSON Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage SQL
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use PhpMyAdmin\Response;
-use stdClass;
-
-/**
- * Handles the json transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage JSON
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_Json extends TransformationsPlugin
-{
- /**
- * No-arg constructor
- */
- public function __construct()
- {
- if (! empty($GLOBALS['cfg']['CodemirrorEnable'])) {
- $response = Response::getInstance();
- $scripts = $response->getHeader()
- ->getScripts();
- $scripts->addFile('vendor/codemirror/lib/codemirror.js');
- $scripts->addFile('vendor/codemirror/mode/javascript/javascript.js');
- $scripts->addFile('vendor/codemirror/addon/runmode/runmode.js');
- $scripts->addFile('transformations/json.js');
- }
- }
-
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Formats text as JSON with syntax highlighting.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- return '<code class="json"><pre>' . "\n"
- . htmlspecialchars($buffer) . "\n"
- . '</pre></code>';
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "JSON";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php
deleted file mode 100644
index 2c39e03..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain SQL Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage SQL
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\SQLTransformationsPlugin;
-use PhpMyAdmin\Response;
-
-/**
- * Handles the sql transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage SQL
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_Sql extends SQLTransformationsPlugin
-{
- /**
- * No-arg constructor
- */
- public function __construct()
- {
- if (! empty($GLOBALS['cfg']['CodemirrorEnable'])) {
- $response = Response::getInstance();
- $scripts = $response->getHeader()
- ->getScripts();
- $scripts->addFile('vendor/codemirror/lib/codemirror.js');
- $scripts->addFile('vendor/codemirror/mode/sql/sql.js');
- $scripts->addFile('vendor/codemirror/addon/runmode/runmode.js');
- $scripts->addFile('functions.js');
- }
- }
-
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php
deleted file mode 100644
index fc06744..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain XML Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage SQL
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Output;
-
-use PhpMyAdmin\Plugins\TransformationsPlugin;
-use PhpMyAdmin\Response;
-use stdClass;
-
-/**
- * Handles the XML transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage XML
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_Xml extends TransformationsPlugin
-{
- /**
- * No-arg constructor
- */
- public function __construct()
- {
- if (! empty($GLOBALS['cfg']['CodemirrorEnable'])) {
- $response = Response::getInstance();
- $scripts = $response->getHeader()
- ->getScripts();
- $scripts->addFile('vendor/codemirror/lib/codemirror.js');
- $scripts->addFile('vendor/codemirror/mode/xml/xml.js');
- $scripts->addFile('vendor/codemirror/addon/runmode/runmode.js');
- $scripts->addFile('transformations/xml.js');
- }
- }
-
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Formats text as XML with syntax highlighting.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- return '<code class="xml"><pre>' . "\n"
- . htmlspecialchars($buffer) . "\n"
- . '</pre></code>';
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-
- /**
- * Gets the transformation name of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "XML";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/README b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/README
deleted file mode 100644
index 7d7a125..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/README
+++ /dev/null
@@ -1,4 +0,0 @@
-TRANSFORMATION USAGE (Garvin Hicking, <me@supergarv.de>)
-====================
-
-See the documentation for complete instructions on how to use transformation plugins.
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/TEMPLATE b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/TEMPLATE
deleted file mode 100644
index 7d2b2ff..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/TEMPLATE
+++ /dev/null
@@ -1,45 +0,0 @@
-<?php
-// vim: expandtab sw=4 ts=4 sts=4:
-/**
- * This file contains the basic structure for a specific MIME Type and Subtype
- * transformations class.
- * For instructions, read the documentation
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage [TransformationName]
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\[TransformationName]TransformationsPlugin;
-
-/**
- * Handles the [TransformationName] transformation for [MIMEType] - [MIMESubtype]
- *
- * @package PhpMyAdmin
- */
-class [MIMEType][MIMESubtype][TransformationName]
- extends [TransformationName]TransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "[MIMEType]";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "[MIMESubtype]";
- }
-}
-?>
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/TEMPLATE_ABSTRACT b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/TEMPLATE_ABSTRACT
deleted file mode 100644
index 4087ac9..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/TEMPLATE_ABSTRACT
+++ /dev/null
@@ -1,73 +0,0 @@
-<?php
-// vim: expandtab sw=4 ts=4 sts=4:
-/**
- * This file contains the basic structure for an abstract class defining a
- * transformation.
- * For instructions, read the documentation
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage [TransformationName]
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations\Abs;
-
-use PhpMyAdmin\Plugins\IOTransformationsPlugin;
-use stdClass;
-
-/**
- * Provides common methods for all of the [TransformationName] transformations plugins.
- *
- * @package PhpMyAdmin
- */
-abstract class [TransformationName]TransformationsPlugin
- extends IOTransformationsPlugin
-{
- /**
- * Gets the transformation description of the specific plugin
- *
- * @return string
- */
- public static function getInfo()
- {
- return __(
- 'Description of the transformation.'
- );
- }
-
- /**
- * Does the actual work of each specific transformations plugin.
- *
- * @param string $buffer text to be transformed
- * @param array $options transformation options
- * @param stdClass|null $meta meta information
- *
- * @return string
- */
- public function applyTransformation($buffer, array $options = [], ?stdClass $meta = null)
- {
- // possibly use a global transform and feed it with special options
-
- // further operations on $buffer using the $options[] array.
-
- // You can evaluate the propagated $meta Object. It's contained fields are described in https://www.php.net/mysql_fetch_field.
- // This stored information can be used to get the field information about the transformed field.
- // $meta->mimetype contains the original MimeType of the field (i.e. 'text/plain', 'image/jpeg' etc.)
-
- return $buffer;
- }
-
- /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */
-
-
- /**
- * Gets the TransformationName of the specific plugin
- *
- * @return string
- */
- public static function getName()
- {
- return "[TransformationName]";
- }
-}
-?>
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_Link.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_Link.php
deleted file mode 100644
index 298919b..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_Link.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain Link Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Link
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\TextLinkTransformationsPlugin;
-
-/**
- * Handles the link transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Link
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_Link extends TextLinkTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_Longtoipv4.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_Longtoipv4.php
deleted file mode 100644
index 5f288a8..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_Longtoipv4.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain Long To IPv4 Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage LongToIPv4
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\LongToIPv4TransformationsPlugin;
-
-/**
- * Handles the long to ipv4 transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage LongToIPv4
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_Longtoipv4 extends LongToIPv4TransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_PreApPend.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_PreApPend.php
deleted file mode 100644
index 4c285fa..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_PreApPend.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain Prepend/Append Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage PreApPend
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\PreApPendTransformationsPlugin;
-
-/**
- * Handles the prepend and/or append transformation for text plain.
- * Has two options: the text to be prepended and appended (if any, default '')
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage PreApPend
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_PreApPend extends PreApPendTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}
diff --git a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_Substring.php b/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_Substring.php
deleted file mode 100644
index 1f21fe1..0000000
--- a/srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Text_Plain_Substring.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/* vim: set expandtab sw=4 ts=4 sts=4: */
-/**
- * Text Plain Substring Transformations plugin for phpMyAdmin
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Substring
- */
-declare(strict_types=1);
-
-namespace PhpMyAdmin\Plugins\Transformations;
-
-use PhpMyAdmin\Plugins\Transformations\Abs\SubstringTransformationsPlugin;
-
-/**
- * Handles the substring transformation for text plain
- *
- * @package PhpMyAdmin-Transformations
- * @subpackage Substring
- */
-// @codingStandardsIgnoreLine
-class Text_Plain_Substring extends SubstringTransformationsPlugin
-{
- /**
- * Gets the plugin`s MIME type
- *
- * @return string
- */
- public static function getMIMEType()
- {
- return "Text";
- }
-
- /**
- * Gets the plugin`s MIME subtype
- *
- * @return string
- */
- public static function getMIMESubtype()
- {
- return "Plain";
- }
-}