Ensure _deprecated_function() exists before calling it. wpdb currently does not have a full functions.php dependency, and this can break external inclusions. see #24774.
git-svn-id: https://develop.svn.wordpress.org/trunk@24724 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8320d68a26
commit
ff7532e518
@ -860,7 +860,7 @@ class wpdb {
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function _weak_escape( $string ) {
|
function _weak_escape( $string ) {
|
||||||
if ( func_num_args() === 1 )
|
if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) )
|
||||||
_deprecated_function( __METHOD__, '3.6', 'wpdb::prepare() or esc_sql()' );
|
_deprecated_function( __METHOD__, '3.6', 'wpdb::prepare() or esc_sql()' );
|
||||||
return addslashes( $string );
|
return addslashes( $string );
|
||||||
}
|
}
|
||||||
@ -918,7 +918,7 @@ class wpdb {
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
function escape( $data ) {
|
function escape( $data ) {
|
||||||
if ( func_num_args() === 1 )
|
if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) )
|
||||||
_deprecated_function( __METHOD__, '3.6', 'wpdb::prepare() or esc_sql()' );
|
_deprecated_function( __METHOD__, '3.6', 'wpdb::prepare() or esc_sql()' );
|
||||||
if ( is_array( $data ) ) {
|
if ( is_array( $data ) ) {
|
||||||
foreach ( $data as $k => $v ) {
|
foreach ( $data as $k => $v ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user