From fdbbe2d307e02dc1f720c427be751c42d53306fd Mon Sep 17 00:00:00 2001 From: kagla Date: Mon, 19 Jul 2021 09:42:53 +0900 Subject: [PATCH] =?UTF-8?q?php5.x=20=EB=B2=84=EC=A0=84=EC=97=90=EC=84=9C?= =?UTF-8?q?=EB=A7=8C=20stripslashes=20=EA=B0=80=20=EB=90=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EB=8A=94=20=EC=98=A4=EB=A5=98=EA=B0=80=20=EC=9E=88?= =?UTF-8?q?=EC=96=B4=20php=207.0=20=EB=AF=B8=EB=A7=8C=20=EB=B2=84=EC=A0=84?= =?UTF-8?q?=EC=97=90=EC=84=9C=20get=5Fmagic=5Fquotes=5Fgpc=20=EA=B0=80=20?= =?UTF-8?q?=EC=8B=A4=ED=96=89=EB=90=98=EB=8F=84=EB=A1=9D=20=EC=98=88?= =?UTF-8?q?=EC=A0=84=20=EC=BD=94=EB=93=9C=EB=A5=BC=20=EB=90=98=EB=8F=8C?= =?UTF-8?q?=EB=A6=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common.php b/common.php index 1ec4ec152..8fbde6e96 100644 --- a/common.php +++ b/common.php @@ -101,6 +101,15 @@ function sql_escape_string($str) //============================================================================== // SQL Injection 등으로 부터 보호를 위해 sql_escape_string() 적용 //------------------------------------------------------------------------------ +// magic_quotes_gpc 에 의한 backslashes 제거 +if (7.0 > (float)phpversion()) { + if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) { + $_POST = array_map_deep('stripslashes', $_POST); + $_GET = array_map_deep('stripslashes', $_GET); + $_COOKIE = array_map_deep('stripslashes', $_COOKIE); + $_REQUEST = array_map_deep('stripslashes', $_REQUEST); + } +} // sql_escape_string 적용 $_POST = array_map_deep(G5_ESCAPE_FUNCTION, $_POST);