Changeset 42343 for trunk/src/wp-includes/ms-load.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/ms-load.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-load.php
r41718 r42343 17 17 */ 18 18 function is_subdomain_install() { 19 if ( defined( 'SUBDOMAIN_INSTALL') )19 if ( defined( 'SUBDOMAIN_INSTALL' ) ) { 20 20 return SUBDOMAIN_INSTALL; 21 } 21 22 22 23 return ( defined( 'VHOST' ) && VHOST == 'yes' ); … … 36 37 function wp_get_active_network_plugins() { 37 38 $active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() ); 38 if ( empty( $active_plugins ) ) 39 if ( empty( $active_plugins ) ) { 39 40 return array(); 40 41 $plugins = array(); 41 } 42 43 $plugins = array(); 42 44 $active_plugins = array_keys( $active_plugins ); 43 45 sort( $active_plugins ); … … 47 49 && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php' 48 50 && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist 49 ) 50 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; 51 ) { 52 $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; 53 } 51 54 } 52 55 return $plugins; … … 76 79 * 77 80 * @param bool null Whether to skip the blog status check. Default null. 78 */81 */ 79 82 $check = apply_filters( 'ms_site_check', null ); 80 if ( null !== $check ) 83 if ( null !== $check ) { 81 84 return true; 85 } 82 86 83 87 // Allow super admins to see blocked sites 84 if ( is_super_admin() ) 88 if ( is_super_admin() ) { 85 89 return true; 90 } 86 91 87 92 $blog = get_site(); 88 93 89 94 if ( '1' == $blog->deleted ) { 90 if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) ) 95 if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) ) { 91 96 return WP_CONTENT_DIR . '/blog-deleted.php'; 92 else97 } else { 93 98 wp_die( __( 'This site is no longer available.' ), '', array( 'response' => 410 ) ); 99 } 94 100 } 95 101 … … 101 107 wp_die( 102 108 /* translators: %s: admin email link */ 103 sprintf( __( 'This site has not been activated yet. If you are having problems activating your site, please contact %s.' ), 109 sprintf( 110 __( 'This site has not been activated yet. If you are having problems activating your site, please contact %s.' ), 104 111 sprintf( '<a href="mailto:%s">%s</a>', $admin_email ) 105 112 ) … … 109 116 110 117 if ( $blog->archived == '1' || $blog->spam == '1' ) { 111 if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) ) 118 if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) ) { 112 119 return WP_CONTENT_DIR . '/blog-suspended.php'; 113 else120 } else { 114 121 wp_die( __( 'This site has been archived or suspended.' ), '', array( 'response' => 410 ) ); 122 } 115 123 } 116 124 … … 228 236 $args = array( 229 237 'domain__in' => $domains, 230 'path__in' => $paths,231 'number' => 1,238 'path__in' => $paths, 239 'number' => 1, 232 240 ); 233 241 … … 241 249 242 250 $result = get_sites( $args ); 243 $site = array_shift( $result );251 $site = array_shift( $result ); 244 252 245 253 if ( $site ) { … … 285 293 // If the network is defined in wp-config.php, we can simply use that. 286 294 if ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) ) { 287 $current_site = new stdClass;288 $current_site->id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1;295 $current_site = new stdClass; 296 $current_site->id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1; 289 297 $current_site->domain = DOMAIN_CURRENT_SITE; 290 $current_site->path = PATH_CURRENT_SITE;298 $current_site->path = PATH_CURRENT_SITE; 291 299 if ( defined( 'BLOG_ID_CURRENT_SITE' ) ) { 292 300 $current_site->blog_id = BLOG_ID_CURRENT_SITE; … … 305 313 $current_blog = get_site_by_path( $domain, $path, 1 ); 306 314 } 307 308 315 } elseif ( ! $subdomain ) { 309 316 /* … … 375 382 // During activation of a new subdomain, the requested site does not yet exist. 376 383 if ( empty( $current_blog ) && wp_installing() ) { 377 $current_blog = new stdClass;384 $current_blog = new stdClass; 378 385 $current_blog->blog_id = $blog_id = 1; 379 $current_blog->public = 1;386 $current_blog->public = 1; 380 387 } 381 388 … … 383 390 if ( empty( $current_blog ) ) { 384 391 // We're going to redirect to the network URL, with some possible modifications. 385 $scheme = is_ssl() ? 'https' : 'http';392 $scheme = is_ssl() ? 'https' : 'http'; 386 393 $destination = "$scheme://{$current_site->domain}{$current_site->path}"; 387 394 … … 455 462 $title = __( 'Error establishing a database connection' ); 456 463 457 $msg = '<h1>' . $title . '</h1>';458 $msg .= '<p>' . __( 'If your site does not display, please contact the owner of this network.' ) . '';459 $msg .= ' ' . __( 'If you are the owner of this network please check that MySQL is running properly and all tables are error free.' ) . '</p>';460 $query = $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->esc_like( $wpdb->site ) );464 $msg = '<h1>' . $title . '</h1>'; 465 $msg .= '<p>' . __( 'If your site does not display, please contact the owner of this network.' ) . ''; 466 $msg .= ' ' . __( 'If you are the owner of this network please check that MySQL is running properly and all tables are error free.' ) . '</p>'; 467 $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->site ) ); 461 468 if ( ! $wpdb->get_var( $query ) ) { 462 469 $msg .= '<p>' . sprintf( … … 476 483 $msg .= '<p><strong>' . __( 'What do I do now?' ) . '</strong> '; 477 484 /* translators: %s: Codex URL */ 478 $msg .= sprintf( __( 'Read the <a href="%s" target="_blank">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.' ), 485 $msg .= sprintf( 486 __( 'Read the <a href="%s" target="_blank">bug report</a> page. Some of the guidelines there may help you figure out what went wrong.' ), 479 487 __( 'https://codex.wordpress.org/Debugging_a_WordPress_Network' ) 480 488 ); 481 489 $msg .= ' ' . __( 'If you’re still stuck with this message, then check that your database contains the following tables:' ) . '</p><ul>'; 482 foreach ( $wpdb->tables( 'global') as $t => $table ) {483 if ( 'sitecategories' == $t ) 490 foreach ( $wpdb->tables( 'global' ) as $t => $table ) { 491 if ( 'sitecategories' == $t ) { 484 492 continue; 493 } 485 494 $msg .= '<li>' . $table . '</li>'; 486 495 }
Note: See TracChangeset
for help on using the changeset viewer.