解决办法是在入口文件增加如下代码则可:
if (!get_magic_quotes_gpc()) { function addslashes_deep($value) { $value = is_array($value) ? array_map('addslashes_deep', $value) : addslashes($value); return $value; } $_POST = array_map('addslashes_deep', $_POST); $_GET = array_map('addslashes_deep', $_GET); $_COOKIE = array_map('addslashes_deep', $_COOKIE); $_REQUEST = array_map('addslashes_deep', $_REQUEST); }
public function escape_string($str) { if (get_magic_quotes_gpc()) { return $str; } if($this->_linkID) { return mysql_real_escape_string($str,$this->_linkID); }else{ return mysql_escape_string($str); } }
public function escape_string($str) { $str = stripslashes($str); if($this->_linkID) { return mysql_real_escape_string($str,$this->_linkID); }else{ return mysql_escape_string($str); } }