Ticket #10187: 10187-10435-merged.patch
File 10187-10435-merged.patch, 4.9 KB (added by , 15 years ago) |
---|
-
wp-admin/includes/misc.php
433 433 } 434 434 435 435 /** 436 * Check if IIS 7 supports pretty permalinks437 *438 * @since 2.8.0439 *440 * @return bool441 */442 function iis7_supports_permalinks() {443 global $is_iis7;444 445 $supports_permalinks = false;446 if ( $is_iis7 ) {447 /* First we check if the DOMDocument class exists. If it does not exist,448 * which is the case for PHP 4.X, then we cannot easily update the xml configuration file,449 * hence we just bail out and tell user that pretty permalinks cannot be used.450 * This is not a big issue because PHP 4.X is going to be depricated and for IIS it451 * is recommended to use PHP 5.X NTS.452 * Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When453 * URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'.454 * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs455 * via ISAPI then pretty permalinks will not work.456 */457 $supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( php_sapi_name() == 'cgi-fcgi' );458 }459 460 return apply_filters('iis7_supports_permalinks', $supports_permalinks);461 }462 463 /**464 436 * Check if rewrite rule for WordPress already exists in the IIS 7 configuration file 465 437 * 466 438 * @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/pluggable.php
839 839 840 840 if ( !function_exists('wp_redirect') ) : 841 841 /** 842 * Redirects to another page , with a workaround for the IIS Set-Cookie bug.842 * Redirects to another page 843 843 * 844 * @link http://support.microsoft.com/kb/q176113/845 844 * @since 1.5.1 846 845 * @uses apply_filters() Calls 'wp_redirect' hook on $location and $status. 847 846 * … … 850 849 * @return bool False if $location is not set 851 850 */ 852 851 function wp_redirect($location, $status = 302) { 853 global $is_IIS;854 855 852 $location = apply_filters('wp_redirect', $location, $status); 856 853 $status = apply_filters('wp_redirect_status', $status, $location); 857 854 858 855 if ( !$location ) // allows the wp_redirect filter to cancel a redirect 859 856 return false; 860 857 861 858 $location = wp_sanitize_redirect($location); 862 863 if ( $is_IIS ) { 864 header("Refresh: 0;url=$location"); 865 } else { 866 if ( php_sapi_name() != 'cgi-fcgi' ) 867 status_header($status); // This causes problems on IIS and some FastCGI setups 868 header("Location: $location", true, $status); 869 } 859 860 header("Location: $location", true, $status); 870 861 } 871 862 endif; 872 863 -
wp-includes/vars.php
82 82 */ 83 83 $is_iis7 = (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/7.') !== false); 84 84 85 /** 86 * Check if IIS 7 supports pretty permalinks 87 * 88 * @since 2.8.0 89 * 90 * @return bool 91 */ 92 function iis7_supports_permalinks() { 93 global $is_iis7; 85 94 95 $supports_permalinks = false; 96 if ( $is_iis7 ) { 97 /* First we check if the DOMDocument class exists. If it does not exist, 98 * which is the case for PHP 4.X, then we cannot easily update the xml configuration file, 99 * hence we just bail out and tell user that pretty permalinks cannot be used. 100 * This is not a big issue because PHP 4.X is going to be depricated and for IIS it 101 * is recommended to use PHP 5.X NTS. 102 * Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When 103 * URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'. 104 * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs 105 * via ISAPI then pretty permalinks will not work. 106 */ 107 $supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( php_sapi_name() == 'cgi-fcgi' ); 108 } 109 110 return apply_filters('iis7_supports_permalinks', $supports_permalinks); 111 } 86 112 ?> 113 No newline at end of file