WordPress.org

Make WordPress Core

Ticket #36403: 36403.diff

File 36403.diff, 1.3 KB (added by andizer, 5 years ago)
  • wp-includes/wp-db.php

     
    11181118         * @since 2.8.0
    11191119         * @access private
    11201120         *
     1121         * @global string $wp_version
     1122         *
    11211123         * @param  string $string to escape
    11221124         * @return string escaped
    11231125         */
    11241126        function _real_escape( $string ) {
     1127                global $wp_version;
    11251128                if ( $this->dbh ) {
    11261129                        if ( $this->use_mysqli ) {
    11271130                                return mysqli_real_escape_string( $this->dbh, $string );
     
    11331136                $class = get_class( $this );
    11341137                if ( function_exists( '__' ) ) {
    11351138                        /* translators: %s: database access abstraction class, usually wpdb or a class extending wpdb */
    1136                         _doing_it_wrong( $class, sprintf( __( '%s must set a database connection for use with escaping.' ), $class ), E_USER_NOTICE );
     1139                        _doing_it_wrong( $class, sprintf( __( '%s must set a database connection for use with escaping.' ), $class ), $wp_version );
    11371140                } else {
    1138                         _doing_it_wrong( $class, sprintf( '%s must set a database connection for use with escaping.', $class ), E_USER_NOTICE );
     1141                        _doing_it_wrong( $class, sprintf( '%s must set a database connection for use with escaping.', $class ), $wp_version );
    11391142                }
    11401143                return addslashes( $string );
    11411144        }