Make WordPress Core

Ticket #22383: 22383.5.diff

File 22383.5.diff, 2.3 KB (added by michaelryanmcneill, 9 years ago)
  • src/wp-admin/network/site-info.php

     
    6868                // On the network's main site, don't allow the domain or path to change.
    6969                $blog_data['domain'] = $details->domain;
    7070                $blog_data['path'] = $details->path;
    71         } elseif ( is_subdomain_install() ) {
    72                 // All parts of a URL can be updated for a subdomain configuration. We first
     71        } else {
     72                // For any other site, the scheme, domain, and path can all be changed. We first
    7373                // need to ensure a scheme has been provided, otherwise fallback to the existing.
    7474                $new_url_scheme = parse_url( $blog_data['url'], PHP_URL_SCHEME );
    7575
     
    8181                $blog_data['scheme'] = $update_parsed_url['scheme'];
    8282                $blog_data['domain'] = $update_parsed_url['host'];
    8383                $blog_data['path'] = $update_parsed_url['path'];
    84         } else {
    85                 // Only the path can be updated for a subdirectory configuration, so capture existing domain.
    86                 $blog_data['domain'] = $details->domain;
    8784        }
    8885
    8986        $existing_details = get_blog_details( $id, false );
     
    174171                        <td><?php echo esc_url( $details->siteurl ); ?></td>
    175172                </tr>
    176173                <?php
    177                 // In a subdomain configuration, the scheme, domain, and path can all be changed.
    178                 elseif ( is_subdomain_install() ) : ?>
     174                // For any other site, the scheme, domain, and path can all be changed.
     175                else : ?>
    179176                <tr class="form-field form-required">
    180177                        <th scope="row"><?php _e( 'Site URL' ); ?></th>
    181178                        <td><input name="blog[url]" type="text" id="url" value="<?php echo $parsed_scheme . '://' . esc_attr( $details->domain ) . esc_attr( $details->path ); ?>" /></td>
    182179                </tr>
    183                 <?php
    184                 // In a subdirectory configuration, only the path can be changed.
    185                 // Scheme and domain are inherited from the network.
    186                 else : ?>
    187                 <tr class="form-field">
    188                         <th scope="row"><?php _e( 'Domain' ); ?></th>
    189                         <td><?php echo $parsed_scheme . ':// ' . esc_attr( $details->domain ); ?></td>
    190                 </tr>
    191                 <tr class="form-field form-required">
    192                         <th scope="row"><label for="path"><?php _e( 'Path' ) ?></label></th>
    193                         <td>
    194                                 <input name="blog[path]" type="text" id="path" value="<?php echo esc_attr( $details->path ) ?>" /><br />
    195                         </td>
    196                 </tr>
    197180                <?php endif; ?>
    198181
    199182                <tr class="form-field">