mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-04 20:54:29 +00:00
Better escaping from class, fixes #1394
git-svn-id: https://develop.svn.wordpress.org/trunk@2684 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -77,7 +77,10 @@ class wpdb {
|
||||
// Format a string correctly for safe insert under all PHP conditions
|
||||
|
||||
function escape($str) {
|
||||
return addslashes($str);
|
||||
if( !$this->dbh || version_compare( phpversion(), '4.3.0' ) == '-1' )
|
||||
return mysql_escape_string( $string );
|
||||
else
|
||||
return mysql_real_escape_string( $string, $this->dbh );
|
||||
}
|
||||
|
||||
// ==================================================================
|
||||
|
||||
Reference in New Issue
Block a user