欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

adodb mysqli_real_escape_string

shiping1 的头像

File: mysqli_driver.inc

Original:
function qstr($string, $magic_quotes=false)
{
if (!$magic_quotes) {
if (strnatcmp(PHP_VERSION, '4.3.0') >= 0) {
return "'" . mysql_real_escape_string($string,
$this->connectionId) . "'";
}
$string = str_replace("'", "\\'" , str_replace('\\',
'\\\\', str_replace("\0", "\\\0", $string)));
return "'" . $string . "'"; 
}
return "'" . str_replace('\\"', '"', $string) . "'";
}

============================================
Fixed:
function qstr($string, $magic_quotes=false)
{
if (!$magic_quotes) {
if (strnatcmp(PHP_VERSION, '4.3.0') >= 0) {
return "'" .
mysqli_real_escape_string($this->connectionId, $string)
. "'";
}
$string = str_replace("'", "\\'" , str_replace('\\',
'\\\\', str_replace("\0", "\\\0", $string)));
return "'" . $string . "'"; 
}
return "'" . str_replace('\\"', '"', $string) . "'";
}

来自 http://sourceforge.net/p/adodblite/bugs/5/
 
来自 https://github.com/ADOdb/ADOdb/blob/master/drivers/adodb-mysqli.inc.php

来自 https://www.mantisbt.org/bugs/view.php?id=19374

 

普通分类: