Ticket #10435: 10435.patch
File 10435.patch, 3.6 KB (added by , 16 years ago) |
---|
-
wp-admin/includes/misc.php
429 429 } 430 430 431 431 /** 432 * Check if IIS 7 supports pretty permalinks433 *434 * @since 2.8.0435 *436 * @return bool437 */438 function iis7_supports_permalinks() {439 global $is_iis7;440 441 $supports_permalinks = false;442 if ( $is_iis7 ) {443 /* First we check if the DOMDocument class exists. If it does not exist,444 * which is the case for PHP 4.X, then we cannot easily update the xml configuration file,445 * hence we just bail out and tell user that pretty permalinks cannot be used.446 * This is not a big issue because PHP 4.X is going to be depricated and for IIS it447 * is recommended to use PHP 5.X NTS.448 * Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When449 * URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'.450 * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs451 * via ISAPI then pretty permalinks will not work.452 */453 $supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( php_sapi_name() == 'cgi-fcgi' );454 }455 456 return apply_filters('iis7_supports_permalinks', $supports_permalinks);457 }458 459 /**460 432 * Check if rewrite rule for WordPress already exists in the IIS 7 configuration file 461 433 * 462 434 * @since 2.8.0 -
wp-includes/canonical.php
39 39 function redirect_canonical($requested_url=null, $do_redirect=true) { 40 40 global $wp_rewrite, $is_IIS, $wp_query, $wpdb; 41 41 42 if ( is_trackback() || is_search() || is_comments_popup() || is_admin() || $is_IIS|| ( isset($_POST) && count($_POST) ) || is_preview() || is_robots() )42 if ( is_trackback() || is_search() || is_comments_popup() || is_admin() || ( $is_IIS && !iis7_supports_permalinks() ) || ( isset($_POST) && count($_POST) ) || is_preview() || is_robots() ) 43 43 return; 44 44 45 45 if ( !$requested_url ) { -
wp-includes/vars.php
79 79 */ 80 80 $is_iis7 = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/7.') !== false); 81 81 82 /** 83 * Check if IIS 7 supports pretty permalinks 84 * 85 * @since 2.8.0 86 * 87 * @return bool 88 */ 89 function iis7_supports_permalinks() { 90 global $is_iis7; 82 91 92 $supports_permalinks = false; 93 if ( $is_iis7 ) { 94 /* First we check if the DOMDocument class exists. If it does not exist, 95 * which is the case for PHP 4.X, then we cannot easily update the xml configuration file, 96 * hence we just bail out and tell user that pretty permalinks cannot be used. 97 * This is not a big issue because PHP 4.X is going to be depricated and for IIS it 98 * is recommended to use PHP 5.X NTS. 99 * Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When 100 * URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'. 101 * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs 102 * via ISAPI then pretty permalinks will not work. 103 */ 104 $supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( php_sapi_name() == 'cgi-fcgi' ); 105 } 106 107 return apply_filters('iis7_supports_permalinks', $supports_permalinks); 108 } 83 109 ?> 110 No newline at end of file