Support IIS 8 and above.

props hurtige for initial patch.
fixes #23533.



git-svn-id: http://core.svn.wordpress.org/trunk@24594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-07-08 20:27:06 +00:00
parent c2db94d10c
commit 740d141e1d
4 changed files with 10 additions and 11 deletions

View File

@ -370,7 +370,7 @@ function set_screen_options() {
} }
/** /**
* Check if rewrite rule for WordPress already exists in the IIS 7 configuration file * Check if rewrite rule for WordPress already exists in the IIS 7+ configuration file
* *
* @since 2.8.0 * @since 2.8.0
* *
@ -428,7 +428,7 @@ function iis7_delete_rewrite_rule($filename) {
} }
/** /**
* Add WordPress rewrite rule to the IIS 7 configuration file. * Add WordPress rewrite rule to the IIS 7+ configuration file.
* *
* @since 2.8.0 * @since 2.8.0
* *

View File

@ -18,7 +18,7 @@
* one or the other. * one or the other.
* *
* Prevents redirection for feeds, trackbacks, searches, comment popup, and * Prevents redirection for feeds, trackbacks, searches, comment popup, and
* admin URLs. Does not redirect on non-pretty-permalink-supporting IIS 7, * admin URLs. Does not redirect on non-pretty-permalink-supporting IIS 7+,
* page/post previews, WP admin, Trackbacks, robots.txt, searches, or on POST * page/post previews, WP admin, Trackbacks, robots.txt, searches, or on POST
* requests. * requests.
* *

View File

@ -3038,7 +3038,7 @@ function apache_mod_loaded($mod, $default = false) {
} }
/** /**
* Check if IIS 7 supports pretty permalinks. * Check if IIS 7+ supports pretty permalinks.
* *
* @since 2.8.0 * @since 2.8.0
* *
@ -3049,11 +3049,10 @@ function iis7_supports_permalinks() {
$supports_permalinks = false; $supports_permalinks = false;
if ( $is_iis7 ) { if ( $is_iis7 ) {
/* First we check if the DOMDocument class exists. If it does not exist, /* First we check if the DOMDocument class exists. If it does not exist, then we cannot
* which is the case for PHP 4.X, then we cannot easily update the xml configuration file, * easily update the xml configuration file, hence we just bail out and tell user that
* hence we just bail out and tell user that pretty permalinks cannot be used. * pretty permalinks cannot be used.
* This is not a big issue because PHP 4.X is going to be deprecated and for IIS it *
* is recommended to use PHP 5.X NTS.
* Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When * Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When
* URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'. * URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'.
* Lastly we make sure that PHP is running via FastCGI. This is important because if it runs * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs

View File

@ -93,10 +93,10 @@ $is_apache = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || strpos(
$is_IIS = !$is_apache && (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer') !== false); $is_IIS = !$is_apache && (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer') !== false);
/** /**
* Whether the server software is IIS 7.X * Whether the server software is IIS 7.X or greater
* @global bool $is_iis7 * @global bool $is_iis7
*/ */
$is_iis7 = $is_IIS && (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/7.') !== false); $is_iis7 = $is_IIS && intval( substr( $_SERVER['SERVER_SOFTWARE'], strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/' ) + 14 ) ) >= 7;
/** /**
* Test if the current browser runs on a mobile device (smart phone, tablet, etc.) * Test if the current browser runs on a mobile device (smart phone, tablet, etc.)