From bc56480db59d796d5bb50aae37016c32b1a0fa3a Mon Sep 17 00:00:00 2001 From: thisgun Date: Mon, 13 Jun 2022 15:26:10 +0900 Subject: [PATCH] =?UTF-8?q?PHP5.2=20=ED=98=B8=ED=99=98=EC=84=B1=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 10 +++++----- plugin/htmlpurifier/HTMLPurifier.standalone.php | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/common.lib.php b/lib/common.lib.php index 7c1e0d26b..ff97d03e3 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1577,6 +1577,10 @@ function sql_data_seek($result, $offset=0) mysql_data_seek($result, $offset); } +function _callback_sql_show_tables($m){ + return "show tables like '".str_replace("`", "", $m[1])."'"; +} + // mysqli_query 와 mysqli_error 를 한꺼번에 처리 // mysql connect resource 지정 - 명랑폐인님 제안 function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR, $link=null) @@ -1595,11 +1599,7 @@ function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR, $link=null) $sql = preg_replace("#^select.*from.*where.*`?information_schema`?.*#i", "select 1", $sql); if (preg_match("#^desc(?:ribe)?\s+(.*)#i", $sql)) { - $sql = preg_replace_callback("#^desc(?:ribe)?\s+(.*)#i", - function ($m) { - return "show tables like '".str_replace("`", "", $m[1])."'"; - }, trim($sql) - ); + $sql = preg_replace_callback("#^desc(?:ribe)?\s+(.*)#i", '_callback_sql_show_tables', trim($sql)); } $is_debug = get_permission_debug_show(); diff --git a/plugin/htmlpurifier/HTMLPurifier.standalone.php b/plugin/htmlpurifier/HTMLPurifier.standalone.php index a15cc2720..5e42bfe6b 100644 --- a/plugin/htmlpurifier/HTMLPurifier.standalone.php +++ b/plugin/htmlpurifier/HTMLPurifier.standalone.php @@ -21914,11 +21914,11 @@ class HTMLPurifier_URIFilter_Munge extends HTMLPurifier_URIFilter $string = $uri->toString(); // always available $this->replace['%s'] = $string; - $this->replace['%r'] = $context->get('EmbeddedURI', true)?: ''; - $token = $context->get('CurrentToken', true) ?: ''; + $this->replace['%r'] = $context->get('EmbeddedURI', true); + $token = $context->get('CurrentToken', true); $this->replace['%n'] = $token ? $token->name : ''; - $this->replace['%m'] = $context->get('CurrentAttr', true) ?: ''; - $this->replace['%p'] = $context->get('CurrentCSSProperty', true) ?: ''; + $this->replace['%m'] = $context->get('CurrentAttr', true); + $this->replace['%p'] = $context->get('CurrentCSSProperty', true); // not always available if ($this->secretKey) { $this->replace['%t'] = hash_hmac("sha256", $string, $this->secretKey);