Changeset 13675 for trunk/wp-admin/network.php
- Timestamp:
- 03/11/2010 10:33:52 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/network.php
r13656 r13675 22 22 23 23 /** 24 * Check for existing network data/tables. 25 * 26 * @since 3.0.0 24 * Check for an existing network. 25 * 26 * @since 3.0.0 27 * @return Whether a network exists. 27 28 */ 28 29 function network_domain_check() { … … 37 38 * 38 39 * @since 3.0.0 40 * @return string Base domain. 39 41 */ 40 42 function get_clean_basedomain() { 41 global $wpdb; 42 $existing_domain = network_domain_check(); 43 if ( $existing_domain ) 43 if ( $existing_domain = network_domain_check() ) 44 44 return $existing_domain; 45 45 $domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) ); 46 if ( strpos( $domain, '/' ) )47 $domain = substr( $domain, 0, strpos( $domain, '/' ));46 if ( $slash = strpos( $domain, '/' ) ) 47 $domain = substr( $domain, 0, $slash ); 48 48 return $domain; 49 49 } … … 281 281 </li> 282 282 <?php 283 284 // @todo custom content dir 283 // Construct an htaccess file. 285 284 $htaccess_file = 'RewriteEngine On 286 285 RewriteBase ' . $base . ' 287 286 288 287 # uploaded files 289 RewriteRule ^(.*/)?files/$ index.php [L] 290 RewriteCond %{REQUEST_URI} !.*wp-content/plugins.* 291 RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L] 292 293 # add a trailing slash to /wp-admin 294 RewriteCond %{REQUEST_URI} ^.*/wp-admin$ 295 RewriteRule ^(.+)$ $1/ [R=301,L] 296 297 RewriteCond %{REQUEST_FILENAME} -f [OR] 288 RewriteRule ^' . ( $vhost ? '([_0-9a-zA-Z-]+/)?' : '' ) . 'files/(.+) wp-includes/ms-files.php?file=$2 [L]' . "\n"; 289 290 if ( ! $vhost ) 291 $htaccess_file .= "\n# add a trailing slash to /wp-admin\n" . 'RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]' . "\n"; 292 293 $htaccess_file .= "\n" . 'RewriteCond %{REQUEST_FILENAME} -f [OR] 298 294 RewriteCond %{REQUEST_FILENAME} -d 299 RewriteRule . - [L] 300 RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] 301 RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] 302 RewriteRule . index.php [L]'; 295 RewriteRule ^ - [L]'; 296 297 // @todo custom content dir. 298 if ( ! $vhost ) 299 $htaccess_file .= "\n" . 'RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] 300 RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]'; 301 302 $htaccess_file .= "\nRewriteRule . index.php [L]"; 303 303 304 ?> 304 305 <li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p> 305 <textarea class="code" readonly="readonly" cols="100" rows=" 18">306 <textarea class="code" readonly="readonly" cols="100" rows="<?php echo $vhost ? 10 : 15; ?>"> 306 307 <?php echo wp_htmledit_pre( $htaccess_file ); ?> 307 308 </textarea></li>
Note: See TracChangeset
for help on using the changeset viewer.