From db9eeb3019cc24b9dd0f751d026b62937a83c821 Mon Sep 17 00:00:00 2001 From: nbachiyski Date: Tue, 30 Nov 2010 20:50:59 +0000 Subject: [PATCH] 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 git-svn-id: http://svn.automattic.com/wordpress/trunk@16634 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/misc.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 9f760b5abe..225798f2ff 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -155,14 +155,12 @@ function iis7_save_url_rewrite_rules(){ $web_config_file = $home_path . 'web.config'; // Using win_is_writable() instead of is_writable() because of a bug in Windows PHP - if ( ( ! file_exists($web_config_file) && win_is_writable($home_path) && $wp_rewrite->using_mod_rewrite_permalinks() ) || win_is_writable($web_config_file) ) { - if ( iis7_supports_permalinks() ) { - $rule = $wp_rewrite->iis7_url_rewrite_rules(false, '', ''); - if ( ! empty($rule) ) { - return iis7_add_rewrite_rule($web_config_file, $rule); - } else { - return iis7_delete_rewrite_rule($web_config_file); - } + 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) ) { + $rule = $wp_rewrite->iis7_url_rewrite_rules(false, '', ''); + if ( ! empty($rule) ) { + return iis7_add_rewrite_rule($web_config_file, $rule); + } else { + return iis7_delete_rewrite_rule($web_config_file); } } return false;