From 5bf66662a9bdd62c5bccab15e607cd95cfb8fcab Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 27 Jul 2020 10:05:23 +0200 Subject: Removed wordpress and phpmyadmin, my server doesn't handle it well and it brings shame on my familly --- .../Abs/Bool2TextTransformationsPlugin.php | 69 --------- .../Abs/CodeMirrorEditorTransformationPlugin.php | 75 ---------- .../Abs/DateFormatTransformationsPlugin.php | 158 -------------------- .../Abs/DownloadTransformationsPlugin.php | 93 ------------ .../Abs/ExternalTransformationsPlugin.php | 160 --------------------- .../Abs/FormattedTransformationsPlugin.php | 65 --------- .../Abs/HexTransformationsPlugin.php | 71 --------- .../Abs/ImageLinkTransformationsPlugin.php | 63 -------- .../Abs/ImageUploadTransformationsPlugin.php | 121 ---------------- .../Abs/InlineTransformationsPlugin.php | 78 ---------- .../Abs/LongToIPv4TransformationsPlugin.php | 66 --------- .../Abs/PreApPendTransformationsPlugin.php | 68 --------- .../Abs/RegexValidationTransformationsPlugin.php | 74 ---------- .../Abs/SQLTransformationsPlugin.php | 62 -------- .../Abs/SubstringTransformationsPlugin.php | 93 ------------ .../Abs/TextFileUploadTransformationsPlugin.php | 103 ------------- .../Abs/TextImageLinkTransformationsPlugin.php | 75 ---------- .../Abs/TextLinkTransformationsPlugin.php | 77 ---------- 18 files changed, 1571 deletions(-) delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/Bool2TextTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/CodeMirrorEditorTransformationPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/DateFormatTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/DownloadTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/FormattedTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/HexTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ImageLinkTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/ImageUploadTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/InlineTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/LongToIPv4TransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/PreApPendTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/RegexValidationTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/SQLTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/SubstringTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextFileUploadTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextImageLinkTransformationsPlugin.php delete mode 100644 srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs/TextLinkTransformationsPlugin.php (limited to 'srcs/phpmyadmin/libraries/classes/Plugins/Transformations/Abs') 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 @@ -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 @@ -'; - } - $class = 'transform_' . strtolower(static::getName()) . '_editor'; - $html .= ''; - - 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 @@ -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 '' . htmlspecialchars((string) $text) . ''; - } - - 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 @@ - $val) { - if ($val->name == $options[1]) { - $pos = $key; - break; - } - } - if (isset($pos)) { - $cn = $row[$pos]; - } - } - if (empty($cn)) { - $cn = 'binary_file.dat'; - } - } - - return sprintf( - '%s', - $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 @@ -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 @@ -'; - } - - - /* ~~~~~~~~~~~~~~~~~~~~ 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 @@ -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 @@ -[BLOB]'; - } - - /* ~~~~~~~~~~~~~~~~~~~~ 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 @@ -'; - $html .= ''; - $src = 'transformation_wrapper.php' . $options['wrapper_link']; - } - $html .= ''
-            . __('Image preview here') . ''; - $html .= '
'; - - 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 @@ -getOptions($options, $cfg['DefaultTransformations']['Inline']); - - if (PMA_IS_GD2) { - return '[' . htmlspecialchars($buffer) . ']'; - } else { - return '[' . htmlspecialchars($buffer) . ']'; - } - } - - - - /* ~~~~~~~~~~~~~~~~~~~~ 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 @@ - 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 @@ -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 @@ -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 @@ -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 @@ -'; - $html .= ''; - } - $html .= ''; - - 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 @@ -getOptions($options, $cfg['DefaultTransformations']['TextImageLink']); - $url = $options[0] . $buffer; - /* Do not allow javascript links */ - if (! Sanitize::checkLink($url, true, true)) { - return htmlspecialchars($url); - } - return '' - . htmlspecialchars($buffer) . ''; - } - - - /* ~~~~~~~~~~~~~~~~~~~~ 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 @@ -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 '' - . htmlspecialchars(isset($options[1]) ? $options[1] : $buffer) - . ''; - } - - - /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ - - /** - * Gets the transformation name of the specific plugin - * - * @return string - */ - public static function getName() - { - return "TextLink"; - } -} -- cgit