Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r15369 r16906  
    2424
    2525        return false;
     26}
     27
     28/**
     29 * Returns array of network plugin files to be included in global scope.
     30 *
     31 * The default directory is wp-content/plugins. To change the default directory
     32 * manually, define <code>WP_PLUGIN_DIR</code> and <code>WP_PLUGIN_URL</code>
     33 * in wp-config.php.
     34 *
     35 * @access private
     36 * @since 3.1.0
     37 * @return array Files to include
     38 */
     39function wp_get_active_network_plugins() {
     40        $active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
     41        if ( empty( $active_plugins ) )
     42                return array();
     43
     44        $plugins = array();
     45        $active_plugins = array_keys( $active_plugins );
     46        sort( $active_plugins );
     47
     48        foreach ( $active_plugins as $plugin ) {
     49                if ( ! validate_file( $plugin ) // $plugin must validate as file
     50                        && '.php' == substr( $plugin, -4 ) // $plugin must end with '.php'
     51                        && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist
     52                        )
     53                $plugins[] = WP_PLUGIN_DIR . '/' . $plugin;
     54        }
     55        return $plugins;
    2656}
    2757
     
    5282
    5383        if ( '1' == $current_blog->deleted ) {
    54                 if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) ) {
     84                if ( file_exists( WP_CONTENT_DIR . '/blog-deleted.php' ) )
    5585                        return WP_CONTENT_DIR . '/blog-deleted.php';
    56                 } else {
    57                         header( 'HTTP/1.1 410 Gone' );
    58                         wp_die( /*WP_I18N_USER_DELETED_BLOG*/'This user has elected to delete their account and the content is no longer available.'/*/WP_I18N_USER_DELETED_BLOG*/ );
    59                 }
     86                else
     87                        wp_die( __( 'This user has elected to delete their account and the content is no longer available.' ), '', array( 'response' => 410 ) );
    6088        }
    6189
     
    6492                        return WP_CONTENT_DIR . '/blog-inactive.php';
    6593                else
    66                         wp_die( sprintf( /*WP_I18N_BLOG_NOT_ACTIVATED*/'This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.'/*/WP_I18N_BLOG_NOT_ACTIVATED*/, str_replace( '@', ' AT ', get_site_option( 'admin_email', "support@{$current_site->domain}" ) ) ) );
     94                        wp_die( sprintf( __( 'This site has not been activated yet. If you are having problems activating your site, please contact <a href="mailto:%1$s">%1$s</a>.' ), str_replace( '@', ' AT ', get_site_option( 'admin_email', "support@{$current_site->domain}" ) ) ) );
    6795        }
    6896
    6997        if ( $current_blog->archived == '1' || $current_blog->spam == '1' ) {
    70                 if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) ) {
     98                if ( file_exists( WP_CONTENT_DIR . '/blog-suspended.php' ) )
    7199                        return WP_CONTENT_DIR . '/blog-suspended.php';
    72                 } else {
    73                         header( 'HTTP/1.1 410 Gone' );
    74                         wp_die( /*WP_I18N_ARCHIVED*/'This site has been archived or suspended.'/*/WP_I18N_ARCHIVED*/ );
    75                 }
     100                else
     101                        wp_die( __( 'This site has been archived or suspended.' ), '', array( 'response' => 410 ) );
    76102        }
    77103
     
    88114function get_current_site_name( $current_site ) {
    89115        global $wpdb;
    90         $current_site->site_name = wp_cache_get( $current_site->id . ':current_site_name', 'site-options' );
     116
     117        $current_site->site_name = wp_cache_get( $current_site->id . ':site_name', 'site-options' );
    91118        if ( ! $current_site->site_name ) {
    92                 $current_site->site_name = wp_cache_get( $current_site->id . ':site_name', 'site-options' );
    93                 if ( ! $current_site->site_name ) {
    94                         $current_site->site_name = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = %d AND meta_key = 'site_name'", $current_site->id ) );
    95                         if ( ! $current_site->site_name )
    96                                 $current_site->site_name = ucfirst( $current_site->domain );
    97                 }
    98                 wp_cache_set( $current_site->id . ':current_site_name', $current_site->site_name, 'site-options' );
    99         }
     119                $current_site->site_name = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = %d AND meta_key = 'site_name'", $current_site->id ) );
     120                if ( ! $current_site->site_name )
     121                        $current_site->site_name = ucfirst( $current_site->domain );
     122        }
     123        wp_cache_set( $current_site->id . ':site_name', $current_site->site_name, 'site-options' );
     124
    100125        return $current_site;
    101126}
Note: See TracChangeset for help on using the changeset viewer.