WordPress.org

Make WordPress Core

Ticket #18117: 18117.diff

File 18117.diff, 1.3 KB (added by jeremyfelt, 8 years ago)
  • src/wp-admin/network/site-info.php

     
    4848        check_admin_referer( 'edit-site' );
    4949
    5050        switch_to_blog( $id );
     51        $blog_data = wp_unslash( $_POST['blog'] );
    5152
     53        // remove forward slashes from front and back of the site domain
     54        $blog_data['domain'] = trim( $blog_data['domain'], '/' );
     55        // ensure one forward slash is present in the front and back of the site path
     56        $blog_data['path']   = trailingslashit( '/' . trim( $blog_data['path'], '/' ) );
     57
    5258        if ( isset( $_POST['update_home_url'] ) && $_POST['update_home_url'] == 'update' ) {
    53                 $blog_address = esc_url_raw( $_POST['blog']['domain'] . $_POST['blog']['path'] );
     59                $blog_address = esc_url_raw( $blog_data['domain'] . $blog_data['path'] );
    5460                if ( get_option( 'siteurl' ) != $blog_address )
    5561                        update_option( 'siteurl', $blog_address );
    5662
     
    6268        delete_option( 'rewrite_rules' );
    6369
    6470        // update blogs table
    65         $blog_data = wp_unslash( $_POST['blog'] );
    6671        $existing_details = get_blog_details( $id, false );
    6772        $blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' );
    6873        foreach ( $blog_data_checkboxes as $c ) {