escape 패턴이 정의되어 있을 경우에만 적용되도록 코드 수정
This commit is contained in:
10
common.php
10
common.php
@ -68,10 +68,14 @@ function array_map_deep($fn, $array)
|
|||||||
// SQL Injection 대응 문자열 필터링
|
// SQL Injection 대응 문자열 필터링
|
||||||
function sql_escape_string($str)
|
function sql_escape_string($str)
|
||||||
{
|
{
|
||||||
$pattern = G5_ESCAPE_PATTERN;
|
if(defined('G5_ESCAPE_PATTERN') && defined('G5_ESCAPE_REPLACE')) {
|
||||||
$replace = G5_ESCAPE_REPLACE;
|
$pattern = G5_ESCAPE_PATTERN;
|
||||||
|
$replace = G5_ESCAPE_REPLACE;
|
||||||
|
|
||||||
|
if($pattern)
|
||||||
|
$str = preg_replace($pattern, $replace, $str);
|
||||||
|
}
|
||||||
|
|
||||||
$str = preg_replace($pattern, $replace, $str);
|
|
||||||
$str = call_user_func('addslashes', $str);
|
$str = call_user_func('addslashes', $str);
|
||||||
|
|
||||||
return $str;
|
return $str;
|
||||||
|
|||||||
Reference in New Issue
Block a user