From 1750d3086331e6368f9b8c70d62e7647cbfc23ed Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 29 Nov 2022 21:00:14 +0000 Subject: [PATCH] Coding Standards: Always use strict type check for `in_array()`. This fixes the currently flagged `WordPress.PHP.StrictInArray.MissingTrueStrict` issues: * `Not using strict comparison for in_array; supply true for third argument.` These all do comparisons with strings, so all the more reason why it is imperative that a strict comparison is used. Follow-up to [47550], [47557], [54155], [53480]. Props jrf. See #56791. Built from https://develop.svn.wordpress.org/trunk@54895 git-svn-id: http://core.svn.wordpress.org/trunk@54447 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-block-type.php | 6 +++--- wp-includes/pluggable.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/class-wp-block-type.php b/wp-includes/class-wp-block-type.php index 505c504037..3b3787740a 100644 --- a/wp-includes/class-wp-block-type.php +++ b/wp-includes/class-wp-block-type.php @@ -299,7 +299,7 @@ class WP_Block_Type { * null when value not found, or void when unknown property name provided. */ public function __get( $name ) { - if ( ! in_array( $name, $this->deprecated_properties ) ) { + if ( ! in_array( $name, $this->deprecated_properties, true ) ) { return; } @@ -327,7 +327,7 @@ class WP_Block_Type { * or false otherwise. */ public function __isset( $name ) { - if ( ! in_array( $name, $this->deprecated_properties ) ) { + if ( ! in_array( $name, $this->deprecated_properties, true ) ) { return false; } @@ -346,7 +346,7 @@ class WP_Block_Type { * @param mixed $value Property value. */ public function __set( $name, $value ) { - if ( ! in_array( $name, $this->deprecated_properties ) ) { + if ( ! in_array( $name, $this->deprecated_properties, true ) ) { $this->{$name} = $value; return; } diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 27e5d91b20..7ed917001b 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -2879,7 +2879,7 @@ if ( ! function_exists( 'get_avatar' ) ) : $extra_attr .= "loading='{$loading}'"; } - if ( in_array( $args['decoding'], array( 'async', 'sync', 'auto' ) ) && ! preg_match( '/\bdecoding\s*=/', $extra_attr ) ) { + if ( in_array( $args['decoding'], array( 'async', 'sync', 'auto' ), true ) && ! preg_match( '/\bdecoding\s*=/', $extra_attr ) ) { if ( ! empty( $extra_attr ) ) { $extra_attr .= ' '; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 1895ce13f7..58170d5bb8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-54894'; +$wp_version = '6.2-alpha-54895'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.