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-admin/update-core.php

    r47230 r47808  
    691691
    692692$upgrade_error = false;
    693 if ( ( 'do-theme-upgrade' == $action || ( 'do-plugin-upgrade' == $action && ! isset( $_GET['plugins'] ) ) )
     693if ( ( 'do-theme-upgrade' === $action || ( 'do-plugin-upgrade' === $action && ! isset( $_GET['plugins'] ) ) )
    694694    && ! isset( $_POST['checked'] ) ) {
    695     $upgrade_error = 'do-theme-upgrade' == $action ? 'themes' : 'plugins';
     695    $upgrade_error = ( 'do-theme-upgrade' === $action ) ? 'themes' : 'plugins';
    696696    $action        = 'upgrade-core';
    697697}
     
    732732);
    733733
    734 if ( 'upgrade-core' == $action ) {
     734if ( 'upgrade-core' === $action ) {
    735735    // Force a update check when requested.
    736736    $force_check = ! empty( $_GET['force-check'] );
     
    796796    require_once ABSPATH . 'wp-admin/admin-footer.php';
    797797
    798 } elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
     798} elseif ( 'do-core-upgrade' === $action || 'do-core-reinstall' === $action ) {
    799799
    800800    if ( ! current_user_can( 'update_core' ) ) {
     
    812812
    813813    require_once ABSPATH . 'wp-admin/admin-header.php';
    814     if ( 'do-core-reinstall' == $action ) {
     814    if ( 'do-core-reinstall' === $action ) {
    815815        $reinstall = true;
    816816    } else {
     
    832832    require_once ABSPATH . 'wp-admin/admin-footer.php';
    833833
    834 } elseif ( 'do-plugin-upgrade' == $action ) {
     834} elseif ( 'do-plugin-upgrade' === $action ) {
    835835
    836836    if ( ! current_user_can( 'update_plugins' ) ) {
     
    870870    require_once ABSPATH . 'wp-admin/admin-footer.php';
    871871
    872 } elseif ( 'do-theme-upgrade' == $action ) {
     872} elseif ( 'do-theme-upgrade' === $action ) {
    873873
    874874    if ( ! current_user_can( 'update_themes' ) ) {
     
    910910    require_once ABSPATH . 'wp-admin/admin-footer.php';
    911911
    912 } elseif ( 'do-translation-upgrade' == $action ) {
     912} elseif ( 'do-translation-upgrade' === $action ) {
    913913
    914914    if ( ! current_user_can( 'update_languages' ) ) {
Note: See TracChangeset for help on using the changeset viewer.