mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-12 13:44:21 +01:00
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:
parent
b58e828475
commit
0cb7fbacc8
@ -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