mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Check that we have a database connection in wpdb::_real_escape(). see #24773.
git-svn-id: https://develop.svn.wordpress.org/trunk@24758 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -876,7 +876,12 @@ class wpdb {
|
||||
* @return string escaped
|
||||
*/
|
||||
function _real_escape( $string ) {
|
||||
return mysql_real_escape_string( $string, $this->dbh );
|
||||
if ( $this->dbh )
|
||||
return mysql_real_escape_string( $string, $this->dbh );
|
||||
|
||||
$class = get_class( $this );
|
||||
_doing_it_wrong( $class, "$class must set a database connection for use with escaping.", E_USER_NOTICE );
|
||||
return addslashes( $string );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user