From c3bd2252f5c86198b7087885f6428ce5d46000ad Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 10 Jan 2015 04:58:49 +0000 Subject: [PATCH] Use `PHP_SAPI` constant instead of `php_sapi_name()` in `iis7_supports_permalinks()`, `wp_fix_server_vars()`, and `wp_redirect()`. See #30799. git-svn-id: https://develop.svn.wordpress.org/trunk@31120 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 2 +- src/wp-includes/load.php | 2 +- src/wp-includes/pluggable.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index bbc11c5f7a..52759950d7 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -3619,7 +3619,7 @@ function iis7_supports_permalinks() { * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs * via ISAPI then pretty permalinks will not work. */ - $supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( php_sapi_name() == 'cgi-fcgi' ); + $supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( PHP_SAPI == 'cgi-fcgi' ); } /** diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index 14f74fc863..99e4b486d6 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -52,7 +52,7 @@ function wp_fix_server_vars() { $_SERVER = array_merge( $default_server_values, $_SERVER ); // Fix for IIS when running with PHP ISAPI - if ( empty( $_SERVER['REQUEST_URI'] ) || ( php_sapi_name() != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) { + if ( empty( $_SERVER['REQUEST_URI'] ) || ( PHP_SAPI != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) { // IIS Mod-Rewrite if ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) { diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php index a2bac5af3f..0c871388b2 100644 --- a/src/wp-includes/pluggable.php +++ b/src/wp-includes/pluggable.php @@ -1172,7 +1172,7 @@ function wp_redirect($location, $status = 302) { $location = wp_sanitize_redirect($location); - if ( !$is_IIS && php_sapi_name() != 'cgi-fcgi' ) + if ( !$is_IIS && PHP_SAPI != 'cgi-fcgi' ) status_header($status); // This causes problems on IIS and some FastCGI setups header("Location: $location", true, $status);