]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/ms-load.php
WordPress 4.2
[autoinstalls/wordpress.git] / wp-includes / ms-load.php
index 652b190962922e717bc396feef6c73e21dbcaf19..bc925baaa9b465676eaf89a75ce1f42af4212d99 100644 (file)
@@ -308,6 +308,8 @@ function get_site_by_path( $domain, $path, $segments = null ) {
                $path_segments = array_slice( $path_segments, 0, $segments );
        }
 
+       $paths = array();
+
        while ( count( $path_segments ) ) {
                $paths[] = '/' . implode( '/', $path_segments ) . '/';
                array_pop( $path_segments );
@@ -393,23 +395,35 @@ function get_site_by_path( $domain, $path, $segments = null ) {
 function ms_not_installed() {
        global $wpdb, $domain, $path;
 
+       if ( ! is_admin() ) {
+               dead_db();
+       }
+
        wp_load_translations_early();
 
        $title = __( 'Error establishing a database connection' );
+
        $msg  = '<h1>' . $title . '</h1>';
-       if ( ! is_admin() ) {
-               die( $msg );
-       }
        $msg .= '<p>' . __( 'If your site does not display, please contact the owner of this network.' ) . '';
        $msg .= ' ' . __( 'If you are the owner of this network please check that MySQL is running properly and all tables are error free.' ) . '</p>';
        $query = $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->esc_like( $wpdb->site ) );
        if ( ! $wpdb->get_var( $query ) ) {
-               $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>';
+               $msg .= '<p>' . sprintf(
+                       /* translators: %s: table name */
+                       __( '<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted %s. You really should look at your database now.' ),
+                       '<code>' . $wpdb->site . '</code>'
+               ) . '</p>';
        } else {
-               $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>';
+               $msg .= '<p>' . sprintf(
+                       /* translators: 1: site url, 2: table name, 3: database name */
+                       __( '<strong>Could not find site %1$s.</strong> Searched for table %2$s in database %3$s. Is that right?' ),
+                       '<code>' . rtrim( $domain . $path, '/' ) . '</code>',
+                       '<code>' . $wpdb->blogs . '</code>',
+                       '<code>' . DB_NAME . '</code>'
+               ) . '</p>';
        }
        $msg .= '<p><strong>' . __( 'What do I do now?' ) . '</strong> ';
-       $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.' );
+       $msg .= __( 'Read the <a target="_blank" href="https://codex.wordpress.org/Debugging_a_WordPress_Network">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.' );
        $msg .= ' ' . __( 'If you&#8217;re still stuck with this message, then check that your database contains the following tables:' ) . '</p><ul>';
        foreach ( $wpdb->tables('global') as $t => $table ) {
                if ( 'sitecategories' == $t )
@@ -418,7 +432,7 @@ function ms_not_installed() {
        }
        $msg .= '</ul>';
 
-       wp_die( $msg, $title );
+       wp_die( $msg, $title, array( 'response' => 500 ) );
 }
 
 /**