WordPress.org

Make WordPress Core

Changeset 47851


Ignore:
Timestamp:
05/23/2020 04:20:10 PM (5 days ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison for more count() calls.

Follow-up to [47848].

Props mukesh27.
Fixes #50232. See #49542.

Location:
trunk/src
Files:
3 edited

Legend:

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

    r47848 r47851  
    287287
    288288    // Passed link category list overwrites existing category list if not empty.
    289     if ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] ) && 0 != count( $linkdata['link_category'] ) ) {
     289    if ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] )
     290        && count( $linkdata['link_category'] ) > 0
     291    ) {
    290292        $link_cats = $linkdata['link_category'];
    291293    } else {
  • trunk/src/wp-includes/class-wp-date-query.php

    r47550 r47851  
    825825            case 'BETWEEN':
    826826            case 'NOT BETWEEN':
    827                 if ( ! is_array( $value ) || 2 != count( $value ) ) {
     827                if ( ! is_array( $value ) || 2 !== count( $value ) ) {
    828828                    $value = array( $value, $value );
    829829                } else {
  • trunk/src/wp-includes/post.php

    r47848 r47851  
    42384238    // Passed post category list overwrites existing category list if not empty.
    42394239    if ( isset( $postarr['post_category'] ) && is_array( $postarr['post_category'] )
    4240             && 0 != count( $postarr['post_category'] ) ) {
     4240        && count( $postarr['post_category'] ) > 0
     4241    ) {
    42414242        $post_cats = $postarr['post_category'];
    42424243    } else {
Note: See TracChangeset for help on using the changeset viewer.