Support IIS 8 and above.
props hurtige for initial patch. fixes #23533. git-svn-id: https://develop.svn.wordpress.org/trunk@24594 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f3b332e9bb
commit
772c90d846
@ -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
|
||||||
*
|
*
|
||||||
|
@ -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.
|
||||||
*
|
*
|
||||||
|
@ -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
|
||||||
|
@ -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.)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user