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: http://core.svn.wordpress.org/trunk@24724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-07-17 21:08:05 +00:00
parent b58e828475
commit 0cb7fbacc8

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