From 26dfe6379f1a740b2280e6485423c608d302277d Mon Sep 17 00:00:00 2001 From: EC2 Default User Date: Thu, 10 Mar 2022 05:31:20 +0000 Subject: [PATCH] =?UTF-8?q?PHP8.1=EC=97=90=EC=84=9C=20DB=20Table=20?= =?UTF-8?q?=EC=A1=B4=EC=9E=AC=EC=9C=A0=EB=AC=B4=20=EA=B2=80=EC=82=AC?= =?UTF-8?q?=EC=8B=9C=20=EC=98=A4=EB=A5=98=EA=B0=80=20=EB=82=98=EB=8A=94=20?= =?UTF-8?q?describe=20=EB=8C=80=EC=8B=A0=20show=20tables=20like=20?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95,=20PHP=20message:=20PHP=20Fatal?= =?UTF-8?q?=20error:=20=20Uncaught=20mysqli=5Fsql=5Fexception:=20Table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.lib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/common.lib.php b/lib/common.lib.php index b8315e2ca..b9fae59b4 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -1593,6 +1593,14 @@ function sql_query($sql, $error=G5_DISPLAY_SQL_ERROR, $link=null) // `information_schema` DB로의 접근을 허락하지 않습니다. $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) + ); + } + $is_debug = get_permission_debug_show(); $start_time = $is_debug ? get_microtime() : 0;