mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
WPDB: Call wp_load_translations_early()
in wpdb::_real_escape()
.
This follows the pattern used in other `wpdb` methods to make sure the i18n functions are available. Follow-up to [29840]. Props nacin, johnbillion. See #32315. Built from https://develop.svn.wordpress.org/trunk@52195 git-svn-id: http://core.svn.wordpress.org/trunk@51787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ab78f7561a
commit
5e48f0c591
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-alpha-52194';
|
||||
$wp_version = '5.9-alpha-52195';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
@ -1247,12 +1247,11 @@ class wpdb {
|
||||
}
|
||||
} else {
|
||||
$class = get_class( $this );
|
||||
if ( function_exists( '__' ) ) {
|
||||
/* translators: %s: Database access abstraction class, usually wpdb or a class extending wpdb. */
|
||||
_doing_it_wrong( $class, sprintf( __( '%s must set a database connection for use with escaping.' ), $class ), '3.6.0' );
|
||||
} else {
|
||||
_doing_it_wrong( $class, sprintf( '%s must set a database connection for use with escaping.', $class ), '3.6.0' );
|
||||
}
|
||||
|
||||
wp_load_translations_early();
|
||||
/* translators: %s: Database access abstraction class, usually wpdb or a class extending wpdb. */
|
||||
_doing_it_wrong( $class, sprintf( __( '%s must set a database connection for use with escaping.' ), $class ), '3.6.0' );
|
||||
|
||||
$escaped = addslashes( $string );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user