WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/10/2014 12:43:32 AM (7 years ago)
Author:
wonderboymusic
Message:

Replace all uses of like_escape() with $wpdb->esc_like().

Props miqrogroove.
See #10041.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-load.php

    r28573 r28712  
    398398    $title = __( 'Error establishing a database connection' );
    399399    $msg  = '<h1>' . $title . '</h1>';
    400     if ( ! is_admin() )
     400    if ( ! is_admin() ) {
    401401        die( $msg );
     402    }
    402403    $msg .= '<p>' . __( 'If your site does not display, please contact the owner of this network.' ) . '';
    403404    $msg .= ' ' . __( 'If you are the owner of this network please check that MySQL is running properly and all tables are error free.' ) . '</p>';
    404     if ( ! $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) )
     405    $query = $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->esc_like( $wpdb->site ) );
     406    if ( ! $wpdb->get_var( $query ) ) {
    405407        $msg .= '<p>' . sprintf( __( '<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted <code>%s</code>. You really should look at your database now.' ), $wpdb->site ) . '</p>';
    406     else
     408    } else {
    407409        $msg .= '<p>' . sprintf( __( '<strong>Could not find site <code>%1$s</code>.</strong> Searched for table <code>%2$s</code> in database <code>%3$s</code>. Is that right?' ), rtrim( $domain . $path, '/' ), $wpdb->blogs, DB_NAME ) . '</p>';
     410    }
    408411    $msg .= '<p><strong>' . __( 'What do I do now?' ) . '</strong> ';
    409412    $msg .= __( 'Read the <a target="_blank" href="http://codex.wordpress.org/Debugging_a_WordPress_Network">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.' );
Note: See TracChangeset for help on using the changeset viewer.