diff --git a/common/legacy.php b/common/legacy.php index edb032f17..b5015abc7 100644 --- a/common/legacy.php +++ b/common/legacy.php @@ -740,33 +740,6 @@ function debugPrint($entry = null): void Rhymix\Framework\Debug::addEntry($entry); } -/** - * @deprecated - */ -function writeSlowlog() -{ - // no-op -} - -/** - * @deprecated - */ -function flushSlowlog() -{ - // no-op -} - -/** - * microtime() return - * - * @deprecated - * @return float - */ -function getMicroTime() -{ - return microtime(true); -} - /** * Delete the second object vars from the first argument * @@ -805,21 +778,6 @@ function getDestroyXeVars($vars) return $vars; } -/** - * Legacy error handler - * - * @deprecated - * @param int $errno - * @param string $errstr - * @param string $file - * @param int $line - * @return void - */ -function handleError($errno, $errstr, $file, $line, $context) -{ - Rhymix\Framework\Debug::addError($errno, $errstr, $file, $line, $context); -} - /** * Trim a given number to a fiven size recursively * @@ -838,18 +796,6 @@ function getNumberingPath($no, int $size = 3): string return $output; } -/** - * Decode the URL in Korean - * - * @deprecated - * @param string $str The url - * @return string - */ -function url_decode($str) -{ - return escape(utf8RawUrlDecode($str)); -} - /** * Sanitize HTML content. * @@ -861,144 +807,6 @@ function removeHackTag($content): string return Rhymix\Framework\Filters\HTMLFilter::clean((string)$content); } -/** - * HTMLPurifier wrapper (Deprecated) - * - * @deprecated - * @param string &$content Target content - * @return void - */ -function purifierHtml(&$content): void -{ - $content = Rhymix\Framework\Filters\HTMLFilter::clean((string)$content); -} - -/** - * Check xmp tag (Deprecated) - * - * @deprecated - * @param string $content Target content - * @return string - */ -function checkXmpTag($content): string -{ - return (string)$content; -} - -/** - * Block widget code (Deprecated) - * - * @deprecated - * @param string $content Taget content - * @return string - **/ -function blockWidgetCode($content): string -{ - return preg_replace('/(<(?:img|div)(?:[^>]*))(widget)(?:(=([^>]*?)>))/is', '$1blocked-widget$3', (string)$content); -} - -/** - * Remove src hack (Deprecated) - * - * @deprecated - * @param array $match - * @return string - */ -function removeSrcHack(array $match): string -{ - return strval($match[0]); -} - -/** - * Check uploaded file (Deprecated) - * - * @deprecated - * @param string $file Taget file path - * @return bool - */ -function checkUploadedFile($file, $filename = null): bool -{ - return true; -} - -/** - * Convert hexa value to RGB - * - * @param string $hexstr - * @return array - */ -if(!function_exists('hexrgb')) -{ - function hexrgb($hex) - { - return hex2rgb($hex); - } -} - -/** - * Php function for mysql old_password() - * provides backward compatibility for zero board4 which uses old_password() of mysql 4.1 earlier versions. - * the function implemented by referring to the source codes of password.c file in mysql - * - * @deprecated - * @param string $password - * @return string - */ -function mysql_pre4_hash_password($password) -{ - return VendorPass::mysql_old_password($password); -} - -/** - * Return the requested script path - * - * @deprecated - * @return string - */ -function getScriptPath() -{ - return RX_BASEURL; -} - -/** - * Return the requested script path - * - * @deprecated - * @return string - */ -function getRequestUriByServerEnviroment() -{ - return preg_replace('/[<>"]/', '', $_SERVER['REQUEST_URI']); -} - -/** - * PHP unescape function of javascript's escape - * Function converts an Javascript escaped string back into a string with specified charset (default is UTF-8). - * Modified function from http://pure-essence.net/stuff/code/utf8RawUrlDecode.phps - * - * @deprecated - * @param string $source - * @return string - */ -function utf8RawUrlDecode($source) -{ - return preg_replace_callback('/%u([0-9a-f]+)/i', function($m) { - return html_entity_decode('&#x' . $m[1] . ';'); - }, rawurldecode($source)); -} - -/** - * Returns utf-8 string of given code - * - * @deprecated - * @param int $num - * @return string - */ -function _code2utf($num) -{ - return html_entity_decode('&#' . $num . ';'); -} - /** * Get whether utf8 or not given string * @@ -1026,18 +834,6 @@ function detectUTF8($string, $return_convert = FALSE, $urldecode = TRUE) } } -/** - * get json encoded string of data - * - * @deprecated - * @param mixed $data - * @return string - */ -function json_encode2($data) -{ - return json_encode($data); -} - /** * Get is current user crawler * @@ -1089,17 +885,6 @@ function stripEmbedTagForAdmin(&$content, $writer_member_srl) return; } -/** - * Require pear - * - * @deprecated - * @return void - */ -function requirePear() -{ - -} - /** * Check for CSRF attacks * @@ -1153,6 +938,20 @@ function changeValueInUrl($key, $requestKey, $dbKey, $urlName = 'success_return_ } } +/** + * Alias to hex2rgb() + * + * @param string $hexstr + * @return array + */ +if(!function_exists('hexrgb')) +{ + function hexrgb($hex) + { + return hex2rgb($hex); + } +} + /** * Polyfill for iconv() */ @@ -1313,6 +1112,11 @@ if(!function_exists('mb_strtolower')) } } +/** + * =========================== DEPRECATED FUNCTIONS =========================== + * ====================== KEPT FOR COMPATIBILITY WITH XE ====================== + */ + /** * Print raw html header * @@ -1373,3 +1177,199 @@ function reload($isOpener = FALSE) $reloadScript = $isOpener ? 'window.opener.location.reload();' : 'window.location.reload();'; echo sprintf('', $reloadScript); } + +/** + * Legacy error handler + * + * @deprecated + * @param int $errno + * @param string $errstr + * @param string $file + * @param int $line + * @return void + */ +function handleError($errno, $errstr, $file, $line, $context) +{ + Rhymix\Framework\Debug::addError($errno, $errstr, $file, $line, $context); +} + +/** + * Alias to microtime(true) + * + * @deprecated + * @return float + */ +function getMicroTime() +{ + return microtime(true); +} + +/** + * Return the requested script path + * + * @deprecated + * @return string + */ +function getScriptPath() +{ + return RX_BASEURL; +} + +/** + * Return the requested script path + * + * @deprecated + * @return string + */ +function getRequestUriByServerEnviroment() +{ + return preg_replace('/[<>"]/', '', $_SERVER['REQUEST_URI']); +} + +/** + * get json encoded string of data + * + * @deprecated + * @param mixed $data + * @return string + */ +function json_encode2($data) +{ + return json_encode($data); +} + +/** + * Decode the URL in Korean + * + * @deprecated + * @param string $str The url + * @return string + */ +function url_decode($str) +{ + return escape(utf8RawUrlDecode($str)); +} + +/** + * Block widget code (Deprecated) + * + * @deprecated + * @param string $content Taget content + * @return string + **/ +function blockWidgetCode($content): string +{ + return preg_replace('/(<(?:img|div)(?:[^>]*))(widget)(?:(=([^>]*?)>))/is', '$1blocked-widget$3', (string)$content); +} + +/** + * HTMLPurifier wrapper (Deprecated) + * + * @deprecated + * @param string &$content Target content + * @return void + */ +function purifierHtml(&$content): void +{ + $content = Rhymix\Framework\Filters\HTMLFilter::clean((string)$content); +} + +/** + * Check xmp tag (Deprecated) + * + * @deprecated + */ +function checkXmpTag($content): string +{ + return (string)$content; +} + +/** + * Remove src hack (Deprecated) + * + * @deprecated + * @param array $match + * @return string + */ +function removeSrcHack(array $match): string +{ + return strval($match[0]); +} + +/** + * Check uploaded file (Deprecated) + * + * @deprecated + * @param string $file Taget file path + * @return bool + */ +function checkUploadedFile($file, $filename = null): bool +{ + return true; +} + +/** + * Php function for mysql old_password() + * provides backward compatibility for zero board4 which uses old_password() of mysql 4.1 earlier versions. + * the function implemented by referring to the source codes of password.c file in mysql + * + * @deprecated + * @param string $password + * @return string + */ +function mysql_pre4_hash_password($password) +{ + return VendorPass::mysql_old_password($password); +} + +/** + * PHP unescape function of javascript's escape + * Function converts an Javascript escaped string back into a string with specified charset (default is UTF-8). + * Modified function from http://pure-essence.net/stuff/code/utf8RawUrlDecode.phps + * + * @deprecated + * @param string $source + * @return string + */ +function utf8RawUrlDecode($source) +{ + return preg_replace_callback('/%u([0-9a-f]+)/i', function($m) { + return html_entity_decode('&#x' . $m[1] . ';'); + }, rawurldecode($source ?? '')); +} + +/** + * Returns utf-8 string of given code + * + * @deprecated + * @param int $num + * @return string + */ +function _code2utf($num) +{ + return html_entity_decode('&#' . $num . ';'); +} + +/** + * @deprecated + */ +function writeSlowlog() +{ + // no-op +} + +/** + * @deprecated + */ +function flushSlowlog() +{ + // no-op +} + +/** + * @deprecated + */ +function requirePear() +{ + // no-op +}