php5.x 버전에서만 stripslashes 가 되지 않는 오류가 있어 php 7.0 미만 버전에서 get_magic_quotes_gpc 가 실행되도록 예전 코드를 되돌림

This commit is contained in:
kagla
2021-07-19 09:42:53 +09:00
parent a58bc5d2fb
commit fdbbe2d307

View File

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