WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (11 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where static strings are involved.

This reduces the number of WordPress.PHP.StrictComparisons.LooseComparison issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.

File:
1 edited

Legend:

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

    r47623 r47808  
    4141
    4242    // Fix for IIS when running with PHP ISAPI.
    43     if ( empty( $_SERVER['REQUEST_URI'] ) || ( PHP_SAPI != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) {
     43    if ( empty( $_SERVER['REQUEST_URI'] ) || ( 'cgi-fcgi' !== PHP_SAPI && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) {
    4444
    4545        if ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) {
     
    138138 */
    139139function wp_favicon_request() {
    140     if ( '/favicon.ico' == $_SERVER['REQUEST_URI'] ) {
     140    if ( '/favicon.ico' === $_SERVER['REQUEST_URI'] ) {
    141141        header( 'Content-Type: image/vnd.microsoft.icon' );
    142142        exit;
     
    629629    }
    630630    while ( ( $plugin = readdir( $dh ) ) !== false ) {
    631         if ( substr( $plugin, -4 ) == '.php' ) {
     631        if ( '.php' === substr( $plugin, -4 ) ) {
    632632            $mu_plugins[] = WPMU_PLUGIN_DIR . '/' . $plugin;
    633633        }
     
    671671    foreach ( $active_plugins as $plugin ) {
    672672        if ( ! validate_file( $plugin )                     // $plugin must validate as file.
    673             && '.php' == substr( $plugin, -4 )              // $plugin must end with '.php'.
     673            && '.php' === substr( $plugin, -4 )             // $plugin must end with '.php'.
    674674            && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist.
    675675            // Not already included as a network plugin.
     
    11691169    while ( true ) {
    11701170        if ( defined( 'WPLANG' ) ) {
    1171             if ( '' == WPLANG ) {
     1171            if ( '' === WPLANG ) {
    11721172                break;
    11731173            }
     
    12641264function is_ssl() {
    12651265    if ( isset( $_SERVER['HTTPS'] ) ) {
    1266         if ( 'on' == strtolower( $_SERVER['HTTPS'] ) ) {
     1266        if ( 'on' === strtolower( $_SERVER['HTTPS'] ) ) {
    12671267            return true;
    12681268        }
Note: See TracChangeset for help on using the changeset viewer.