issue:17149595

PHP6에서 magic_quotes_gpc 함수 사용안하도록 수정 


git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4472 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2008-08-29 06:25:19 +00:00
parent 1eee3363e5
commit 59c72699d4
8 changed files with 12 additions and 9 deletions

View file

@ -489,12 +489,12 @@
if($key == "page" || $key == "cpage" || substr($key,-3)=="srl") $val = (int)$val;
else if(is_array($val) && count($val) ) {
foreach($val as $k => $v) {
if(get_magic_quotes_gpc()) $v = stripslashes($v);
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $v = stripslashes($v);
$v = trim($v);
$val[$k] = $v;
}
} else {
if(get_magic_quotes_gpc()) $val = stripslashes($val);
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $val = stripslashes($val);
$val = trim($val);
}

View file

@ -102,7 +102,7 @@
**/
function addQuotes($string) {
if(!$this->fd) return $string;
if(get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
if(!is_numeric($string)) $string = str_replace("'","''",$string);
return $string;
}

View file

@ -113,7 +113,7 @@
* @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절
**/
function addQuotes($string) {
if(get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
if(!is_numeric($string)) $string = @mysql_escape_string($string);
return $string;
}

View file

@ -114,7 +114,7 @@
* @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절
**/
function addQuotes($string) {
if(get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
if(!is_numeric($string)) $string = @mysql_escape_string($string);
return $string;
}

View file

@ -108,7 +108,7 @@
* @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절
**/
function addQuotes($string) {
if(get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
if(!is_numeric($string)) $string = @pg_escape_string($string);
return $string;
}

View file

@ -116,7 +116,7 @@
* @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절
**/
function addQuotes($string) {
if(get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
if(!is_numeric($string)) $string = str_replace("'","''", $string);
return $string;
}

View file

@ -123,7 +123,7 @@
* @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절
**/
function addQuotes($string) {
if(get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
if(!is_numeric($string)) $string = str_replace("'","''",$string);
return $string;
}

View file

@ -72,7 +72,10 @@
}
fclose($socket);
return array($code, $body);
$ret->result_code = $code;
$ret->body = $body;
return $ret;
}
}
?>