diff --git a/wp-admin/options-permalink.php b/wp-admin/options-permalink.php index 224e2224ce..978ffacd22 100644 --- a/wp-admin/options-permalink.php +++ b/wp-admin/options-permalink.php @@ -66,6 +66,30 @@ if ( is_multisite() && ! is_subdomain_install() && is_main_site() && 0 === strpo $blog_prefix = '/blog'; } +$category_base = get_option( 'category_base' ); +$tag_base = get_option( 'tag_base' ); +$update_required = false; + +if ( $iis7_permalinks ) { + if ( ( ! file_exists($home_path . 'web.config') && win_is_writable($home_path) ) || win_is_writable($home_path . 'web.config') ) + $writable = true; + else + $writable = false; +} elseif ( $is_nginx ) { + $writable = false; +} else { + if ( ( ! file_exists( $home_path . '.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' ) ) { + $writable = true; + } else { + $writable = false; + $existing_rules = array_filter( extract_from_markers( $home_path . '.htaccess', 'WordPress' ) ); + $new_rules = array_filter( explode( "\n", $wp_rewrite->mod_rewrite_rules() ) ); + $update_required = ( $new_rules !== $existing_rules ); + } +} + +$usingpi = $wp_rewrite->using_index_permalinks(); + if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) { check_admin_referer('update-permalink'); @@ -124,30 +148,6 @@ if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) { exit; } -$category_base = get_option( 'category_base' ); -$tag_base = get_option( 'tag_base' ); -$update_required = false; - -if ( $iis7_permalinks ) { - if ( ( ! file_exists($home_path . 'web.config') && win_is_writable($home_path) ) || win_is_writable($home_path . 'web.config') ) - $writable = true; - else - $writable = false; -} elseif ( $is_nginx ) { - $writable = false; -} else { - if ( ( ! file_exists( $home_path . '.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' ) ) { - $writable = true; - } else { - $writable = false; - $existing_rules = array_filter( extract_from_markers( $home_path . '.htaccess', 'WordPress' ) ); - $new_rules = array_filter( explode( "\n", $wp_rewrite->mod_rewrite_rules() ) ); - $update_required = ( $new_rules !== $existing_rules ); - } -} - -$usingpi = $wp_rewrite->using_index_permalinks(); - flush_rewrite_rules(); require( ABSPATH . 'wp-admin/admin-header.php' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index b282441fd7..a61efc486a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6-beta3-38065'; +$wp_version = '4.6-beta3-38066'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.