From 5b4174e409df9cbabbe3f20fcc4fa1092f9f8a72 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 23 May 2020 16:22:07 +0000 Subject: [PATCH] Coding Standards: Use strict comparison for more `count()` calls. Follow-up to [47848]. Props mukesh27. Fixes #50232. See #49542. Built from https://develop.svn.wordpress.org/trunk@47851 git-svn-id: http://core.svn.wordpress.org/trunk@47627 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/bookmark.php | 4 +++- wp-includes/class-wp-date-query.php | 2 +- wp-includes/post.php | 3 ++- wp-includes/version.php | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/bookmark.php b/wp-admin/includes/bookmark.php index b66513e362..f55cb39bf0 100644 --- a/wp-admin/includes/bookmark.php +++ b/wp-admin/includes/bookmark.php @@ -286,7 +286,9 @@ function wp_update_link( $linkdata ) { $link = wp_slash( $link ); // Passed link category list overwrites existing category list if not empty. - if ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] ) && 0 != count( $linkdata['link_category'] ) ) { + if ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] ) + && count( $linkdata['link_category'] ) > 0 + ) { $link_cats = $linkdata['link_category']; } else { $link_cats = $link['link_category']; diff --git a/wp-includes/class-wp-date-query.php b/wp-includes/class-wp-date-query.php index 0ce712d368..95346d45e4 100644 --- a/wp-includes/class-wp-date-query.php +++ b/wp-includes/class-wp-date-query.php @@ -824,7 +824,7 @@ class WP_Date_Query { case 'BETWEEN': case 'NOT BETWEEN': - if ( ! is_array( $value ) || 2 != count( $value ) ) { + if ( ! is_array( $value ) || 2 !== count( $value ) ) { $value = array( $value, $value ); } else { $value = array_values( $value ); diff --git a/wp-includes/post.php b/wp-includes/post.php index 570bb6590b..b5eff61a06 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -4237,7 +4237,8 @@ function wp_update_post( $postarr = array(), $wp_error = false ) { // Passed post category list overwrites existing category list if not empty. if ( isset( $postarr['post_category'] ) && is_array( $postarr['post_category'] ) - && 0 != count( $postarr['post_category'] ) ) { + && count( $postarr['post_category'] ) > 0 + ) { $post_cats = $postarr['post_category']; } else { $post_cats = $post['post_category']; diff --git a/wp-includes/version.php b/wp-includes/version.php index aac595f517..c1c32e2130 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-47850'; +$wp_version = '5.5-alpha-47851'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.