Ticket #21143: 21143.3.diff
File 21143.3.diff, 2.8 KB (added by , 11 years ago) |
---|
-
src/wp-includes/ms-settings.php
110 110 111 111 // If we don't have a network by now, we have a problem. 112 112 if ( empty( $current_site ) ) { 113 /** 114 * Fires before ms_not_installed() when a network cannot be found to 115 * fill $current_site. 116 * 117 * @since 3.9.0 118 * 119 * @param string $domain Originally requested domain. 120 * @param string $path Originally requested path. 121 */ 122 do_action( 'network_not_found', $domain, $path ); 123 113 124 ms_not_installed(); 114 125 } 115 126 … … 130 141 } 131 142 } 132 143 144 if ( defined( 'WP_INSTALLING' ) && empty( $current_blog ) ) { 145 $current_blog->blog_id = $blog_id = 1; 146 } 147 133 148 // If we haven't figured out our site, give up. 134 149 if ( empty( $current_blog ) ) { 135 if ( defined( 'WP_INSTALLING' ) ) { 136 $current_blog->blog_id = $blog_id = 1; 150 /** 151 * Fires before redirect or ms_not_installed when a site cannot be 152 * found to fill $current_blog. 153 * 154 * @since 3.9.0 155 * 156 * @param object $current_site Contains network properties. 157 * @param string $domain Originally requested domain. 158 * @param string $path Originally requested path. 159 */ 160 do_action( 'site_not_found', $current_site, $domain, $path ); 137 161 138 } elseif ( is_subdomain_install() ) {139 // @todo This is only for an open registration subdomain network.140 if ( defined( 'NOBLOGREDIRECT' ) ) { 141 if ( '%siteurl%' === NOBLOGREDIRECT ) {142 $destination = "http://" . $current_site->domain . $current_site->path;143 } else{144 $destination = NOBLOGREDIRECT;145 }162 if ( is_subdomain_install() ) { 163 $wpdb->set_blog_id( 0, $current_site->id ); 164 165 if ( defined( 'NOBLOGREDIRECT' ) && '%siteurl%' !== NOBLOGREDIRECT ) { 166 $destination = NOBLOGREDIRECT; 167 } elseif ( 'none' !== get_site_option( 'registration', 'none' ) ) { 168 // Only redirect to signup if registrations of some form are enabled. 169 $destination = 'http://' . $current_site->domain . $current_site->path . 'wp-signup.php?new=' . str_replace( '.' . $current_site->domain, '', $domain ); 146 170 } else { 147 $destination = 'http://' . $current_site->domain . $current_site->path . 'wp-signup.php?new=' . str_replace( '.' . $current_site->domain, '', $domain );171 $destination = 'http://' . $current_site->domain . $current_site->path; 148 172 } 149 173 header( 'Location: ' . $destination ); 150 174 exit; 151 175 } elseif ( 0 !== strcasecmp( $current_site->domain, $domain ) ) { 176 header( 'Location: http://' . $current_site->domain . $current_site->path ); 177 exit; 152 178 } else { 153 if ( 0 !== strcasecmp( $current_site->domain, $domain ) ) {154 header( 'Location: http://' . $current_site->domain . $current_site->path );155 exit;156 }157 179 ms_not_installed(); 158 180 } 159 181 }