Make WordPress Core


Ignore:
Timestamp:
04/15/2023 12:09:08 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where strlen() is involved.

Follow-up to [649], [1345], [3034], [6132], [6314], [6974], [55642].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/load.php

    r55537 r55652  
    4141
    4242    // Fix for IIS when running with PHP ISAPI.
    43     if ( empty( $_SERVER['REQUEST_URI'] ) || ( 'cgi-fcgi' !== PHP_SAPI && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) {
     43    if ( empty( $_SERVER['REQUEST_URI'] )
     44        || ( 'cgi-fcgi' !== PHP_SAPI && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) )
     45    ) {
    4446
    4547        if ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) {
     
    7274
    7375    // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests.
    74     if ( isset( $_SERVER['SCRIPT_FILENAME'] ) && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) == strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 ) ) {
     76    if ( isset( $_SERVER['SCRIPT_FILENAME'] )
     77        && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) === strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 )
     78    ) {
    7579        $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'];
    7680    }
Note: See TracChangeset for help on using the changeset viewer.