From d93027078e926c45c66f59f7003bd90b423969c4 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Mon, 15 Aug 2022 18:31:10 +0900 Subject: [PATCH] Mark old, rarely used, and/or not recommended functions as deprecated --- common/functions.php | 1 + common/legacy.php | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/common/functions.php b/common/functions.php index e5bb71d98..27720de26 100644 --- a/common/functions.php +++ b/common/functions.php @@ -557,6 +557,7 @@ function tobool($input) /** * Counts members of an array or an object. * + * @deprecated * @param mixed $array_or_object * @return int */ diff --git a/common/legacy.php b/common/legacy.php index 4fa67ddb4..8fb4bfe3c 100644 --- a/common/legacy.php +++ b/common/legacy.php @@ -705,6 +705,7 @@ function debugPrint($entry = null) } /** + * @deprecated * @param string $type query, trigger * @param float $elapsed_time * @param object $obj @@ -715,6 +716,7 @@ function writeSlowlog($type, $elapsed_time, $obj) } /** + * @deprecated * @param void */ function flushSlowlog() @@ -773,6 +775,7 @@ function getDestroyXeVars($vars) /** * Legacy error handler * + * @deprecated * @param int $errno * @param string $errstr * @param string $file @@ -804,12 +807,13 @@ function getNumberingPath($no, $size = 3) /** * Decode the URL in Korean * + * @deprecated * @param string $str The url * @return string */ function url_decode($str) { - return htmlspecialchars(utf8RawUrlDecode($str), null, 'UTF-8'); + return escape(utf8RawUrlDecode($str)); } /** @@ -826,6 +830,7 @@ function removeHackTag($content) /** * HTMLPurifier wrapper (Deprecated) * + * @deprecated * @param string &$content Target content * @return string */ @@ -837,6 +842,7 @@ function purifierHtml(&$content) /** * Check xmp tag (Deprecated) * + * @deprecated * @param string $content Target content * @return string */ @@ -848,6 +854,7 @@ function checkXmpTag($content) /** * Block widget code (Deprecated) * + * @deprecated * @param string $content Taget content * @return string **/ @@ -859,6 +866,7 @@ function blockWidgetCode($content) /** * Remove src hack (Deprecated) * + * @deprecated * @param array $match * @return string */ @@ -870,6 +878,7 @@ function removeSrcHack($match) /** * Check uploaded file (Deprecated) * + * @deprecated * @param string $file Taget file path * @return bool */ @@ -897,6 +906,7 @@ if(!function_exists('hexrgb')) * 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 */ @@ -908,6 +918,7 @@ function mysql_pre4_hash_password($password) /** * Return the requested script path * + * @deprecated * @return string */ function getScriptPath() @@ -918,6 +929,7 @@ function getScriptPath() /** * Return the requested script path * + * @deprecated * @return string */ function getRequestUriByServerEnviroment() @@ -930,6 +942,7 @@ function getRequestUriByServerEnviroment() * 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 */ @@ -943,6 +956,7 @@ function utf8RawUrlDecode($source) /** * Returns utf-8 string of given code * + * @deprecated * @param int $num * @return string */ @@ -981,6 +995,7 @@ function detectUTF8($string, $return_convert = FALSE, $urldecode = TRUE) /** * get json encoded string of data * + * @deprecated * @param mixed $data * @return string */ @@ -1042,6 +1057,7 @@ function stripEmbedTagForAdmin(&$content, $writer_member_srl) /** * Require pear * + * @deprecated * @return void */ function requirePear()