From ff7532e518ea9652fc23bef9b459ffed488bffdc Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 17 Jul 2013 21:08:05 +0000 Subject: [PATCH] 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 --- wp-includes/wp-db.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 2c4c28262f..16230ae493 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -860,7 +860,7 @@ class wpdb { * @return 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()' ); return addslashes( $string ); } @@ -918,7 +918,7 @@ class wpdb { * @return mixed */ 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()' ); if ( is_array( $data ) ) { foreach ( $data as $k => $v ) {