<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[26120] trunk/src: Use get_current_site() instead of the $current_site global when possible.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/26120">26120</a></dd>
<dt>Author</dt> <dd>SergeyBiryukov</dd>
<dt>Date</dt> <dd>2013-11-13 03:22:48 +0000 (Wed, 13 Nov 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>Use get_current_site() instead of the $current_site global when possible.
props jeremyfelt.
fixes <a href="http://core.trac.wordpress.org/ticket/25158">#25158</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminadminheaderphp">trunk/src/wp-admin/admin-header.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpmssiteslisttablephp">trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpmsuserslisttablephp">trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesmsphp">trunk/src/wp-admin/includes/ms.php</a></li>
<li><a href="#trunksrcwpadminincludesschemaphp">trunk/src/wp-admin/includes/schema.php</a></li>
<li><a href="#trunksrcwpadminincludesupgradephp">trunk/src/wp-admin/includes/upgrade.php</a></li>
<li><a href="#trunksrcwpincludesadminbarphp">trunk/src/wp-includes/admin-bar.php</a></li>
<li><a href="#trunksrcwpincludesclasswpxmlrpcserverphp">trunk/src/wp-includes/class-wp-xmlrpc-server.php</a></li>
<li><a href="#trunksrcwpincludeshttpphp">trunk/src/wp-includes/http.php</a></li>
<li><a href="#trunksrcwpincludeslinktemplatephp">trunk/src/wp-includes/link-template.php</a></li>
<li><a href="#trunksrcwpincludesmsblogsphp">trunk/src/wp-includes/ms-blogs.php</a></li>
<li><a href="#trunksrcwpincludesmsdefaultconstantsphp">trunk/src/wp-includes/ms-default-constants.php</a></li>
<li><a href="#trunksrcwpincludesmsfunctionsphp">trunk/src/wp-includes/ms-functions.php</a></li>
<li><a href="#trunksrcwpincludesmsloadphp">trunk/src/wp-includes/ms-load.php</a></li>
<li><a href="#trunksrcwploginphp">trunk/src/wp-login.php</a></li>
<li><a href="#trunksrcwpsignupphp">trunk/src/wp-signup.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminadminheaderphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/admin-header.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/admin-header.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-admin/admin-header.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -12,8 +12,10 @@
</span><span class="cx">
</span><span class="cx"> // In case admin-header.php is included in a function.
</span><span class="cx"> global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version,
</span><del>- $current_site, $update_title, $total_update_count, $parent_file;
</del><ins>+ $update_title, $total_update_count, $parent_file;
</ins><span class="cx">
</span><ins>+$current_site = get_current_site();
+
</ins><span class="cx"> // Catch plugins that include admin-header.php before admin.php completes.
</span><span class="cx"> if ( empty( $current_screen ) )
</span><span class="cx"> set_current_screen();
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpmssiteslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -21,8 +21,10 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function prepare_items() {
</span><del>- global $s, $mode, $wpdb, $current_site;
</del><ins>+ global $s, $mode, $wpdb;
</ins><span class="cx">
</span><ins>+ $current_site = get_current_site();
+
</ins><span class="cx"> $mode = ( empty( $_REQUEST['mode'] ) ) ? 'list' : $_REQUEST['mode'];
</span><span class="cx">
</span><span class="cx"> $per_page = $this->get_items_per_page( 'sites_network_per_page' );
</span><span class="lines">@@ -168,7 +170,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function display_rows() {
</span><del>- global $current_site, $mode;
</del><ins>+ global $mode;
</ins><span class="cx">
</span><span class="cx"> $status_list = array(
</span><span class="cx"> 'archived' => array( 'site-archived', __( 'Archived' ) ),
</span><span class="lines">@@ -202,7 +204,7 @@
</span><span class="cx"> }
</span><span class="cx"> echo "<tr class='$class'>";
</span><span class="cx">
</span><del>- $blogname = ( is_subdomain_install() ) ? str_replace( '.'.$current_site->domain, '', $blog['domain'] ) : $blog['path'];
</del><ins>+ $blogname = ( is_subdomain_install() ) ? str_replace( '.' . get_current_site()->domain, '', $blog['domain'] ) : $blog['path'];
</ins><span class="cx">
</span><span class="cx"> list( $columns, $hidden ) = $this->get_column_info();
</span><span class="cx">
</span><span class="lines">@@ -251,7 +253,7 @@
</span><span class="cx">
</span><span class="cx"> $actions['edit'] = '<span class="edit"><a href="' . esc_url( network_admin_url( 'site-info.php?id=' . $blog['blog_id'] ) ) . '">' . __( 'Edit' ) . '</a></span>';
</span><span class="cx"> $actions['backend'] = "<span class='backend'><a href='" . esc_url( get_admin_url( $blog['blog_id'] ) ) . "' class='edit'>" . __( 'Dashboard' ) . '</a></span>';
</span><del>- if ( $current_site->blog_id != $blog['blog_id'] ) {
</del><ins>+ if ( get_current_site()->blog_id != $blog['blog_id'] ) {
</ins><span class="cx"> if ( get_blog_status( $blog['blog_id'], 'deleted' ) == '1' )
</span><span class="cx"> $actions['activate'] = '<span class="activate"><a href="' . esc_url( wp_nonce_url( network_admin_url( 'sites.php?action=confirm&action2=activateblog&id=' . $blog['blog_id'] . '&msg=' . urlencode( sprintf( __( 'You are about to activate the site %s' ), $blogname ) ) ), 'confirm' ) ) . '">' . __( 'Activate' ) . '</a></span>';
</span><span class="cx"> else
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpmsuserslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-admin/includes/class-wp-ms-users-list-table.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function display_rows() {
</span><del>- global $current_site, $mode;
</del><ins>+ global $mode;
</ins><span class="cx">
</span><span class="cx"> $alt = '';
</span><span class="cx"> $super_admins = get_super_admins();
</span><span class="lines">@@ -223,7 +223,7 @@
</span><span class="cx">
</span><span class="cx"> $path = ( $val->path == '/' ) ? '' : $val->path;
</span><span class="cx"> echo '<span class="site-' . $val->site_id . '" >';
</span><del>- echo '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>';
</del><ins>+ echo '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . str_replace( '.' . get_current_site()->domain, '', $val->domain . $path ) . '</a>';
</ins><span class="cx"> echo ' <small class="row-actions">';
</span><span class="cx"> $actions = array();
</span><span class="cx"> $actions['edit'] = '<a href="'. esc_url( network_admin_url( 'site-info.php?id=' . $val->userblog_id ) ) .'">' . __( 'Edit' ) . '</a>';
</span></span></pre></div>
<a id="trunksrcwpadminincludesmsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/ms.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/ms.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-admin/includes/ms.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> * @return void
</span><span class="cx"> */
</span><span class="cx"> function wpmu_delete_blog( $blog_id, $drop = false ) {
</span><del>- global $wpdb, $current_site;
</del><ins>+ global $wpdb;
</ins><span class="cx">
</span><span class="cx"> $switch = false;
</span><span class="cx"> if ( get_current_blog_id() != $blog_id ) {
</span><span class="lines">@@ -82,6 +82,8 @@
</span><span class="cx">
</span><span class="cx"> update_blog_status( $blog_id, 'deleted', 1 );
</span><span class="cx">
</span><ins>+ $current_site = get_current_site();
+
</ins><span class="cx"> // Don't destroy the initial, main, or root blog.
</span><span class="cx"> if ( $drop && ( 1 == $blog_id || is_main_site( $blog_id ) || ( $blog->path == $current_site->path && $blog->domain == $current_site->domain ) ) )
</span><span class="cx"> $drop = false;
</span></span></pre></div>
<a id="trunksrcwpadminincludesschemaphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/schema.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/schema.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-admin/includes/schema.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -327,7 +327,7 @@
</span><span class="cx"> * @uses $wp_db_version
</span><span class="cx"> */
</span><span class="cx"> function populate_options() {
</span><del>- global $wpdb, $wp_db_version, $current_site, $wp_current_db_version;
</del><ins>+ global $wpdb, $wp_db_version, $wp_current_db_version;
</ins><span class="cx">
</span><span class="cx"> $guessurl = wp_guess_url();
</span><span class="cx"> /**
</span><span class="lines">@@ -495,7 +495,7 @@
</span><span class="cx"> // 3.0 multisite
</span><span class="cx"> if ( is_multisite() ) {
</span><span class="cx"> /* translators: blog tagline */
</span><del>- $options[ 'blogdescription' ] = sprintf(__('Just another %s site'), $current_site->site_name );
</del><ins>+ $options[ 'blogdescription' ] = sprintf(__('Just another %s site'), get_current_site()->site_name );
</ins><span class="cx"> $options[ 'permalink_structure' ] = '/%year%/%monthnum%/%day%/%postname%/';
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunksrcwpadminincludesupgradephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-admin/includes/upgrade.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-admin/includes/upgrade.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-admin/includes/upgrade.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -100,8 +100,8 @@
</span><span class="cx"> *
</span><span class="cx"> * @param int $user_id User ID.
</span><span class="cx"> */
</span><del>-function wp_install_defaults($user_id) {
- global $wpdb, $wp_rewrite, $current_site, $table_prefix;
</del><ins>+function wp_install_defaults( $user_id ) {
+ global $wpdb, $wp_rewrite, $table_prefix;
</ins><span class="cx">
</span><span class="cx"> // Default category
</span><span class="cx"> $cat_name = __('Uncategorized');
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx"> $first_post = __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' );
</span><span class="cx">
</span><span class="cx"> $first_post = str_replace( "SITE_URL", esc_url( network_home_url() ), $first_post );
</span><del>- $first_post = str_replace( "SITE_NAME", $current_site->site_name, $first_post );
</del><ins>+ $first_post = str_replace( "SITE_NAME", get_current_site()->site_name, $first_post );
</ins><span class="cx"> } else {
</span><span class="cx"> $first_post = __('Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!');
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunksrcwpincludesadminbarphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/admin-bar.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/admin-bar.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-includes/admin-bar.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -243,8 +243,6 @@
</span><span class="cx"> * @param WP_Admin_Bar $wp_admin_bar
</span><span class="cx"> */
</span><span class="cx"> function wp_admin_bar_site_menu( $wp_admin_bar ) {
</span><del>- global $current_site;
-
</del><span class="cx"> // Don't show for logged out users.
</span><span class="cx"> if ( ! is_user_logged_in() )
</span><span class="cx"> return;
</span><span class="lines">@@ -259,9 +257,9 @@
</span><span class="cx"> $blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() );
</span><span class="cx">
</span><span class="cx"> if ( is_network_admin() ) {
</span><del>- $blogname = sprintf( __('Network Admin: %s'), esc_html( $current_site->site_name ) );
</del><ins>+ $blogname = sprintf( __('Network Admin: %s'), esc_html( get_current_site()->site_name ) );
</ins><span class="cx"> } elseif ( is_user_admin() ) {
</span><del>- $blogname = sprintf( __('Global Dashboard: %s'), esc_html( $current_site->site_name ) );
</del><ins>+ $blogname = sprintf( __('Global Dashboard: %s'), esc_html( get_current_site()->site_name ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> $title = wp_html_excerpt( $blogname, 40, '…' );
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpxmlrpcserverphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/class-wp-xmlrpc-server.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/class-wp-xmlrpc-server.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-includes/class-wp-xmlrpc-server.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -459,7 +459,6 @@
</span><span class="cx"> * - 'xmlrpc' - url of xmlrpc endpoint
</span><span class="cx"> */
</span><span class="cx"> function wp_getUsersBlogs( $args ) {
</span><del>- global $current_site;
</del><span class="cx"> // If this isn't on WPMU then just use blogger_getUsersBlogs
</span><span class="cx"> if ( !is_multisite() ) {
</span><span class="cx"> array_unshift( $args, 1 );
</span><span class="lines">@@ -481,7 +480,7 @@
</span><span class="cx">
</span><span class="cx"> foreach ( $blogs as $blog ) {
</span><span class="cx"> // Don't include blogs that aren't hosted at this site
</span><del>- if ( $blog->site_id != $current_site->id )
</del><ins>+ if ( $blog->site_id != get_current_site()->id )
</ins><span class="cx"> continue;
</span><span class="cx">
</span><span class="cx"> $blog_id = $blog->userblog_id;
</span></span></pre></div>
<a id="trunksrcwpincludeshttpphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/http.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/http.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-includes/http.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -545,11 +545,11 @@
</span><span class="cx"> * @return bool
</span><span class="cx"> */
</span><span class="cx"> function ms_allowed_http_request_hosts( $is_external, $host ) {
</span><del>- global $wpdb, $current_site;
</del><ins>+ global $wpdb;
</ins><span class="cx"> static $queried = array();
</span><span class="cx"> if ( $is_external )
</span><span class="cx"> return $is_external;
</span><del>- if ( $host === $current_site->domain )
</del><ins>+ if ( $host === get_current_site()->domain )
</ins><span class="cx"> return true;
</span><span class="cx"> if ( isset( $queried[ $host ] ) )
</span><span class="cx"> return $queried[ $host ];
</span></span></pre></div>
<a id="trunksrcwpincludeslinktemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/link-template.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/link-template.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-includes/link-template.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -2187,11 +2187,11 @@
</span><span class="cx"> * @return string Site url link with optional path appended.
</span><span class="cx"> */
</span><span class="cx"> function network_site_url( $path = '', $scheme = null ) {
</span><del>- global $current_site;
-
</del><span class="cx"> if ( ! is_multisite() )
</span><span class="cx"> return site_url($path, $scheme);
</span><span class="cx">
</span><ins>+ $current_site = get_current_site();
+
</ins><span class="cx"> if ( 'relative' == $scheme )
</span><span class="cx"> $url = $current_site->path;
</span><span class="cx"> else
</span><span class="lines">@@ -2218,11 +2218,10 @@
</span><span class="cx"> * @return string Home url link with optional path appended.
</span><span class="cx"> */
</span><span class="cx"> function network_home_url( $path = '', $scheme = null ) {
</span><del>- global $current_site;
-
</del><span class="cx"> if ( ! is_multisite() )
</span><span class="cx"> return home_url($path, $scheme);
</span><span class="cx">
</span><ins>+ $current_site = get_current_site();
</ins><span class="cx"> $orig_scheme = $scheme;
</span><span class="cx">
</span><span class="cx"> if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) )
</span></span></pre></div>
<a id="trunksrcwpincludesmsblogsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/ms-blogs.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/ms-blogs.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-includes/ms-blogs.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -64,8 +64,9 @@
</span><span class="cx"> * @return int A blog id
</span><span class="cx"> */
</span><span class="cx"> function get_id_from_blogname( $slug ) {
</span><del>- global $wpdb, $current_site;
</del><ins>+ global $wpdb;
</ins><span class="cx">
</span><ins>+ $current_site = get_current_site();
</ins><span class="cx"> $slug = trim( $slug, '/' );
</span><span class="cx">
</span><span class="cx"> $blog_id = wp_cache_get( 'get_id_from_blogname_' . $slug, 'blog-details' );
</span></span></pre></div>
<a id="trunksrcwpincludesmsdefaultconstantsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/ms-default-constants.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/ms-default-constants.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-includes/ms-default-constants.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> * @since 3.0.0
</span><span class="cx"> */
</span><span class="cx"> function ms_cookie_constants( ) {
</span><del>- global $current_site;
</del><ins>+ $current_site = get_current_site();
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * @since 1.2.0
</span></span></pre></div>
<a id="trunksrcwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/ms-functions.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/ms-functions.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-includes/ms-functions.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -535,9 +535,10 @@
</span><span class="cx"> * @param string $blog_title The blog title provided by the user.
</span><span class="cx"> * @return array Contains the new site data and error messages.
</span><span class="cx"> */
</span><del>-function wpmu_validate_blog_signup($blogname, $blog_title, $user = '') {
- global $wpdb, $domain, $current_site;
</del><ins>+function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) {
+ global $wpdb, $domain;
</ins><span class="cx">
</span><ins>+ $current_site = get_current_site();
</ins><span class="cx"> $base = $current_site->path;
</span><span class="cx">
</span><span class="cx"> $blog_title = strip_tags( $blog_title );
</span><span class="lines">@@ -709,13 +710,11 @@
</span><span class="cx"> * @return bool
</span><span class="cx"> */
</span><span class="cx"> function wpmu_signup_blog_notification( $domain, $path, $title, $user, $user_email, $key, $meta = array() ) {
</span><del>- global $current_site;
-
</del><span class="cx"> if ( !apply_filters('wpmu_signup_blog_notification', $domain, $path, $title, $user, $user_email, $key, $meta) )
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> // Send email with activation link.
</span><del>- if ( !is_subdomain_install() || $current_site->id != 1 )
</del><ins>+ if ( !is_subdomain_install() || get_current_site()->id != 1 )
</ins><span class="cx"> $activate_url = network_site_url("wp-activate.php?key=$key");
</span><span class="cx"> else
</span><span class="cx"> $activate_url = "http://{$domain}{$path}wp-activate.php?key=$key"; // @todo use *_url() API
</span><span class="lines">@@ -1122,8 +1121,8 @@
</span><span class="cx"> * @param int $blog_id The value returned by insert_blog().
</span><span class="cx"> * @param string $blog_title The title of the new site.
</span><span class="cx"> */
</span><del>-function install_blog($blog_id, $blog_title = '') {
- global $wpdb, $wp_roles, $current_site;
</del><ins>+function install_blog( $blog_id, $blog_title = '' ) {
+ global $wpdb, $wp_roles;
</ins><span class="cx">
</span><span class="cx"> // Cast for security
</span><span class="cx"> $blog_id = (int) $blog_id;
</span><span class="lines">@@ -1151,7 +1150,7 @@
</span><span class="cx"> if ( get_site_option( 'ms_files_rewriting' ) )
</span><span class="cx"> update_option( 'upload_path', UPLOADBLOGSDIR . "/$blog_id/files" );
</span><span class="cx"> else
</span><del>- update_option( 'upload_path', get_blog_option( $current_site->blog_id, 'upload_path' ) );
</del><ins>+ update_option( 'upload_path', get_blog_option( get_current_site()->blog_id, 'upload_path' ) );
</ins><span class="cx">
</span><span class="cx"> update_option( 'blogname', wp_unslash( $blog_title ) );
</span><span class="cx"> update_option( 'admin_email', '' );
</span><span class="lines">@@ -1205,7 +1204,7 @@
</span><span class="cx"> * @return bool
</span><span class="cx"> */
</span><span class="cx"> function wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta = array() ) {
</span><del>- global $current_site;
</del><ins>+ $current_site = get_current_site();
</ins><span class="cx">
</span><span class="cx"> if ( !apply_filters('wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta) )
</span><span class="cx"> return false;
</span><span class="lines">@@ -1269,7 +1268,7 @@
</span><span class="cx"> * @return bool
</span><span class="cx"> */
</span><span class="cx"> function wpmu_welcome_user_notification( $user_id, $password, $meta = array() ) {
</span><del>- global $current_site;
</del><ins>+ $current_site = get_current_site();
</ins><span class="cx">
</span><span class="cx"> if ( !apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta) )
</span><span class="cx"> return false;
</span><span class="lines">@@ -1560,8 +1559,7 @@
</span><span class="cx"> * @return array The current site's domain
</span><span class="cx"> */
</span><span class="cx"> function redirect_this_site( $deprecated = '' ) {
</span><del>- global $current_site;
- return array( $current_site->domain );
</del><ins>+ return array( get_current_site()->domain );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -1689,11 +1687,10 @@
</span><span class="cx"> * @param array $meta
</span><span class="cx"> */
</span><span class="cx"> function add_new_user_to_blog( $user_id, $password, $meta ) {
</span><del>- global $current_site;
</del><span class="cx"> if ( !empty( $meta[ 'add_to_blog' ] ) ) {
</span><span class="cx"> $blog_id = $meta[ 'add_to_blog' ];
</span><span class="cx"> $role = $meta[ 'new_role' ];
</span><del>- remove_user_from_blog($user_id, $current_site->blog_id); // remove user from main blog.
</del><ins>+ remove_user_from_blog($user_id, get_current_site()->blog_id); // remove user from main blog.
</ins><span class="cx"> add_user_to_blog( $blog_id, $user_id, $role );
</span><span class="cx"> update_user_meta( $user_id, 'primary_blog', $blog_id );
</span><span class="cx"> }
</span><span class="lines">@@ -1705,8 +1702,7 @@
</span><span class="cx"> * @since MU
</span><span class="cx"> */
</span><span class="cx"> function fix_phpmailer_messageid( $phpmailer ) {
</span><del>- global $current_site;
- $phpmailer->Hostname = $current_site->domain;
</del><ins>+ $phpmailer->Hostname = get_current_site()->domain;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesmsloadphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/ms-load.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/ms-load.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-includes/ms-load.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -71,8 +71,6 @@
</span><span class="cx"> * @return bool|string Returns true on success, or drop-in file to include.
</span><span class="cx"> */
</span><span class="cx"> function ms_site_check() {
</span><del>- global $wpdb, $current_site;
-
</del><span class="cx"> $blog = get_blog_details();
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -101,7 +99,7 @@
</span><span class="cx"> if ( file_exists( WP_CONTENT_DIR . '/blog-inactive.php' ) )
</span><span class="cx"> return WP_CONTENT_DIR . '/blog-inactive.php';
</span><span class="cx"> else
</span><del>- 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}" ) ) ) );
</del><ins>+ 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@' . get_current_site()->domain ) ) ) );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ( $blog->archived == '1' || $blog->spam == '1' ) {
</span></span></pre></div>
<a id="trunksrcwploginphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-login.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-login.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-login.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -30,8 +30,8 @@
</span><span class="cx"> * @param string $wp_error Optional. The error to pass. Default empty.
</span><span class="cx"> * @param WP_Error $wp_error Optional. WordPress Error Object
</span><span class="cx"> */
</span><del>-function login_header($title = 'Log In', $message = '', $wp_error = '') {
- global $error, $interim_login, $current_site, $action;
</del><ins>+function login_header( $title = 'Log In', $message = '', $wp_error = '' ) {
+ global $error, $interim_login, $action;
</ins><span class="cx">
</span><span class="cx"> // Don't index any of these forms
</span><span class="cx"> add_action( 'login_head', 'wp_no_robots' );
</span><span class="lines">@@ -90,7 +90,7 @@
</span><span class="cx">
</span><span class="cx"> if ( is_multisite() ) {
</span><span class="cx"> $login_header_url = network_home_url();
</span><del>- $login_header_title = $current_site->site_name;
</del><ins>+ $login_header_title = get_current_site()->site_name;
</ins><span class="cx"> } else {
</span><span class="cx"> $login_header_url = __( 'http://wordpress.org/' );
</span><span class="cx"> $login_header_title = __( 'Powered by WordPress' );
</span><span class="lines">@@ -262,7 +262,7 @@
</span><span class="cx"> * @return bool|WP_Error True: when finish. WP_Error on error
</span><span class="cx"> */
</span><span class="cx"> function retrieve_password() {
</span><del>- global $wpdb, $current_site, $wp_hasher;
</del><ins>+ global $wpdb, $wp_hasher;
</ins><span class="cx">
</span><span class="cx"> $errors = new WP_Error();
</span><span class="cx">
</span></span></pre></div>
<a id="trunksrcwpsignupphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-signup.php (26119 => 26120)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-signup.php 2013-11-13 03:20:44 UTC (rev 26119)
+++ trunk/src/wp-signup.php 2013-11-13 03:22:48 UTC (rev 26120)
</span><span class="lines">@@ -87,8 +87,8 @@
</span><span class="cx"> * @param string $blog_title The new site title
</span><span class="cx"> * @param array $errors
</span><span class="cx"> */
</span><del>-function show_blog_form($blogname = '', $blog_title = '', $errors = '') {
- global $current_site;
</del><ins>+function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
+ $current_site = get_current_site();
</ins><span class="cx"> // Blog name
</span><span class="cx"> if ( !is_subdomain_install() )
</span><span class="cx"> echo '<label for="blogname">' . __('Site Name:') . '</label>';
</span><span class="lines">@@ -225,8 +225,7 @@
</span><span class="cx"> * @param string $blog_title The new blog title
</span><span class="cx"> * @param array $errors
</span><span class="cx"> */
</span><del>-function signup_another_blog($blogname = '', $blog_title = '', $errors = '') {
- global $current_site;
</del><ins>+function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) {
</ins><span class="cx"> $current_user = wp_get_current_user();
</span><span class="cx">
</span><span class="cx"> if ( ! is_wp_error($errors) ) {
</span><span class="lines">@@ -258,7 +257,7 @@
</span><span class="cx"> $blog_title = $filtered_results['blog_title'];
</span><span class="cx"> $errors = $filtered_results['errors'];
</span><span class="cx">
</span><del>- echo '<h2>' . sprintf( __( 'Get <em>another</em> %s site in seconds' ), $current_site->site_name ) . '</h2>';
</del><ins>+ echo '<h2>' . sprintf( __( 'Get <em>another</em> %s site in seconds' ), get_current_site()->site_name ) . '</h2>';
</ins><span class="cx">
</span><span class="cx"> if ( $errors->get_error_code() ) {
</span><span class="cx"> echo '<p>' . __( 'There was a problem, please correct the form below and try again.' ) . '</p>';
</span><span class="lines">@@ -395,8 +394,8 @@
</span><span class="cx"> * @param string $user_email The user's email
</span><span class="cx"> * @param array $errors
</span><span class="cx"> */
</span><del>-function signup_user($user_name = '', $user_email = '', $errors = '') {
- global $current_site, $active_signup;
</del><ins>+function signup_user( $user_name = '', $user_email = '', $errors = '' ) {
+ global $active_signup;
</ins><span class="cx">
</span><span class="cx"> if ( !is_wp_error($errors) )
</span><span class="cx"> $errors = new WP_Error();
</span><span class="lines">@@ -429,7 +428,7 @@
</span><span class="cx">
</span><span class="cx"> ?>
</span><span class="cx">
</span><del>- <h2><?php printf( __( 'Get your own %s account in seconds' ), $current_site->site_name ) ?></h2>
</del><ins>+ <h2><?php printf( __( 'Get your own %s account in seconds' ), get_current_site()->site_name ) ?></h2>
</ins><span class="cx"> <form id="setupform" method="post" action="wp-signup.php">
</span><span class="cx"> <input type="hidden" name="stage" value="validate-user-signup" />
</span><span class="cx"> <?php
</span></span></pre>
</div>
</div>
</body>
</html>