Make WordPress Core

Ticket #12002: 12002.5.diff

File 12002.5.diff, 1.3 KB (added by jeremyfelt, 9 years ago)
  • src/wp-admin/options-permalink.php

     
    5050
    5151$home_path = get_home_path();
    5252$iis7_permalinks = iis7_supports_permalinks();
     53$permalink_structure = get_option( 'permalink_structure' );
    5354
    5455$prefix = $blog_prefix = '';
    5556if ( ! got_url_rewrite() )
    5657        $prefix = '/index.php';
    57 if ( is_multisite() && !is_subdomain_install() && is_main_site() )
     58
     59/**
     60 * In a subdirectory configuration of multisite, the `/blog` prefix is used by
     61 * default on the main site to avoid collisions with other sites created on that
     62 * network. If the `permalink_structure` option has been changed to remove this
     63 * base prefix, WordPress core can no longer account for the possible collision.
     64 */
     65if ( is_multisite() && ! is_subdomain_install() && is_main_site() && 0 === strpos( $permalink_structure, '/blog/' ) ) {
    5866        $blog_prefix = '/blog';
     67}
    5968
    6069if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) {
    6170        check_admin_referer('update-permalink');
     
    94103        exit;
    95104}
    96105
    97 $permalink_structure = get_option( 'permalink_structure' );
    98106$category_base       = get_option( 'category_base' );
    99107$tag_base            = get_option( 'tag_base' );
    100108$update_required     = false;