Make WordPress Core


Ignore:
Timestamp:
12/14/2010 08:31:33 AM (15 years ago)
Author:
dd32
Message:

Fix fatal error on IIS after r16797. props peaceablewhale. Limit variable string searching when possible. See #10187

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/misc.php

    r16660 r16904  
    380380
    381381/**
    382  * Check if IIS 7 supports pretty permalinks
    383  *
    384  * @since 2.8.0
    385  *
    386  * @return bool
    387  */
    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 it
    397          * 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. When
    399          * 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 runs
    401          * 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 /**
    410382 * Check if rewrite rule for WordPress already exists in the IIS 7 configuration file
    411383 *
Note: See TracChangeset for help on using the changeset viewer.