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:
Andrew Nacin 2013-07-17 21:08:05 +00:00
parent 8320d68a26
commit ff7532e518

View File

@ -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 ) {