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/includes/bookmark.php

    r47291 r47808  
    4040    $_POST['link_image'] = esc_html( $_POST['link_image'] );
    4141    $_POST['link_rss']   = esc_url( $_POST['link_rss'] );
    42     if ( ! isset( $_POST['link_visible'] ) || 'N' != $_POST['link_visible'] ) {
     42    if ( ! isset( $_POST['link_visible'] ) || 'N' !== $_POST['link_visible'] ) {
    4343        $_POST['link_visible'] = 'Y';
    4444    }
     
    175175    }
    176176
    177     if ( trim( $link_name ) == '' ) {
    178         if ( trim( $link_url ) != '' ) {
     177    if ( '' === trim( $link_name ) ) {
     178        if ( '' !== trim( $link_url ) ) {
    179179            $link_name = $link_url;
    180180        } else {
     
    183183    }
    184184
    185     if ( trim( $link_url ) == '' ) {
     185    if ( '' === trim( $link_url ) ) {
    186186        return 0;
    187187    }
     
    310310function wp_link_manager_disabled_message() {
    311311    global $pagenow;
    312     if ( 'link-manager.php' != $pagenow && 'link-add.php' != $pagenow && 'link.php' != $pagenow ) {
     312
     313    if ( ! in_array( $pagenow, array( 'link-manager.php', 'link-add.php', 'link.php' ), true ) ) {
    313314        return;
    314315    }
Note: See TracChangeset for help on using the changeset viewer.