mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
Better escaping from class, fixes #1394
git-svn-id: http://svn.automattic.com/wordpress/trunk@2684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
56c304f8bb
commit
76fd741767
@ -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 );
|
||||
}
|
||||
|
||||
// ==================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user