Update DBA::escape to match dbesc()
This commit is contained in:
parent
cfa68c52b9
commit
d3a598f589
|
@ -251,12 +251,16 @@ class DBA
|
|||
}
|
||||
|
||||
public static function escape($str) {
|
||||
if (self::$connected) {
|
||||
switch (self::$driver) {
|
||||
case 'pdo':
|
||||
return substr(@self::$connection->quote($str, PDO::PARAM_STR), 1, -1);
|
||||
case 'mysqli':
|
||||
return @self::$connection->real_escape_string($str);
|
||||
}
|
||||
} else {
|
||||
return str_replace("'", "\\'", $str);
|
||||
}
|
||||
}
|
||||
|
||||
public static function connected() {
|
||||
|
|
Loading…
Reference in a new issue