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);