Make WordPress Core

Changeset 16634


Ignore:
Timestamp:
11/30/2010 08:50:59 PM (13 years ago)
Author:
nbachiyski
Message:

Run the iis7_supports_permalinks() check first

  • It's cheapest, most of the others involve disk operations
  • Doesn't go through win_is_writable(), which can't avoid relying on the @ operator
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/misc.php

    r16623 r16634  
    156156
    157157    // Using win_is_writable() instead of is_writable() because of a bug in Windows PHP
    158     if ( ( ! file_exists($web_config_file) && win_is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable($web_config_file) ) {
    159         if ( iis7_supports_permalinks() ) {
    160             $rule = $wp_rewrite->iis7_url_rewrite_rules(false, '', '');
    161             if ( ! empty($rule) ) {
    162                 return iis7_add_rewrite_rule($web_config_file, $rule);
    163             } else {
    164                 return iis7_delete_rewrite_rule($web_config_file);
    165             }
     158    if ( iis7_supports_permalinks() && ( ! file_exists($web_config_file) && win_is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable($web_config_file) ) {
     159        $rule = $wp_rewrite->iis7_url_rewrite_rules(false, '', '');
     160        if ( ! empty($rule) ) {
     161            return iis7_add_rewrite_rule($web_config_file, $rule);
     162        } else {
     163            return iis7_delete_rewrite_rule($web_config_file);
    166164        }
    167165    }
Note: See TracChangeset for help on using the changeset viewer.