diff --git a/common.php b/common.php index 7e2db059a..d12c2f05f 100644 --- a/common.php +++ b/common.php @@ -80,10 +80,10 @@ if (file_exists($dbconfig_file)) { } // mysql_real_escape_string 적용 - $_POST = array_map_deep('mysql_real_escape_string', $_POST); - $_GET = array_map_deep('mysql_real_escape_string', $_GET); - $_COOKIE = array_map_deep('mysql_real_escape_string', $_COOKIE); - $_REQUEST = array_map_deep('mysql_real_escape_string', $_REQUEST); + $_POST = array_map_deep(G5_ESCAPE_FUNCTION, $_POST); + $_GET = array_map_deep(G5_ESCAPE_FUNCTION, $_GET); + $_COOKIE = array_map_deep(G5_ESCAPE_FUNCTION, $_COOKIE); + $_REQUEST = array_map_deep(G5_ESCAPE_FUNCTION, $_REQUEST); //============================================================================== // PHP 4.1.0 부터 지원됨 diff --git a/config.php b/config.php index 4739baf1c..8782b3820 100644 --- a/config.php +++ b/config.php @@ -153,6 +153,10 @@ define('G5_SMTP', '127.0.0.1'); 기타 상수 ********************/ +// escape string 처리 함수 지정 +// POST 등에서 한글이 깨질 경우 addslashes 로 변경 +define('G5_ESCAPE_FUNCTION', 'mysql_real_escape_string'); + // 게시판에서 링크의 기본개수를 말합니다. // 필드를 추가하면 이 숫자를 필드수에 맞게 늘려주십시오. define('G5_LINK_COUNT', 2);