Ticket #10187: 10187-16880-merged.patch
File 10187-16880-merged.patch, 2.9 KB (added by , 14 years ago) |
---|
-
wp-includes/vars.php
88 88 */ 89 89 $is_iis7 = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/7.') !== false); 90 90 91 /** 92 * Check if IIS 7 supports pretty permalinks 93 * 94 * @since 2.8.0 95 * 96 * @return bool 97 */ 98 function iis7_supports_permalinks() { 99 global $is_iis7; 91 100 101 $supports_permalinks = false; 102 if ( $is_iis7 ) { 103 /* First we check if the DOMDocument class exists. If it does not exist, 104 * which is the case for PHP 4.X, then we cannot easily update the xml configuration file, 105 * hence we just bail out and tell user that pretty permalinks cannot be used. 106 * This is not a big issue because PHP 4.X is going to be depricated and for IIS it 107 * is recommended to use PHP 5.X NTS. 108 * Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When 109 * URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'. 110 * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs 111 * via ISAPI then pretty permalinks will not work. 112 */ 113 $supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( php_sapi_name() == 'cgi-fcgi' ); 114 } 115 116 return apply_filters('iis7_supports_permalinks', $supports_permalinks); 117 } 92 118 ?> 119 No newline at end of file -
wp-admin/includes/misc.php
379 379 } 380 380 381 381 /** 382 * Check if IIS 7 supports pretty permalinks383 *384 * @since 2.8.0385 *386 * @return bool387 */388 function iis7_supports_permalinks() {389 global $is_iis7;390 391 $supports_permalinks = false;392 if ( $is_iis7 ) {393 /* First we check if the DOMDocument class exists. If it does not exist,394 * which is the case for PHP 4.X, then we cannot easily update the xml configuration file,395 * hence we just bail out and tell user that pretty permalinks cannot be used.396 * This is not a big issue because PHP 4.X is going to be depricated and for IIS it397 * is recommended to use PHP 5.X NTS.398 * Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When399 * URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'.400 * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs401 * via ISAPI then pretty permalinks will not work.402 */403 $supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( php_sapi_name() == 'cgi-fcgi' );404 }405 406 return apply_filters('iis7_supports_permalinks', $supports_permalinks);407 }408 409 /**410 382 * Check if rewrite rule for WordPress already exists in the IIS 7 configuration file 411 383 * 412 384 * @since 2.8.0