From 9c45d9c140e0f521df981b0eb5319ffff97a3e70 Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Fri, 1 Jul 2022 16:23:02 +0200
Subject: [PATCH] CS/QA: always use strict comparisons when using `in_array()`
---
src/wp-includes/class-wp-block-type.php | 6 +++---
src/wp-includes/pluggable.php | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/wp-includes/class-wp-block-type.php b/src/wp-includes/class-wp-block-type.php
index 505c504037..3b3787740a 100644
a
|
b
|
class WP_Block_Type { |
299 | 299 | * null when value not found, or void when unknown property name provided. |
300 | 300 | */ |
301 | 301 | public function __get( $name ) { |
302 | | if ( ! in_array( $name, $this->deprecated_properties ) ) { |
| 302 | if ( ! in_array( $name, $this->deprecated_properties, true ) ) { |
303 | 303 | return; |
304 | 304 | } |
305 | 305 | |
… |
… |
class WP_Block_Type { |
327 | 327 | * or false otherwise. |
328 | 328 | */ |
329 | 329 | public function __isset( $name ) { |
330 | | if ( ! in_array( $name, $this->deprecated_properties ) ) { |
| 330 | if ( ! in_array( $name, $this->deprecated_properties, true ) ) { |
331 | 331 | return false; |
332 | 332 | } |
333 | 333 | |
… |
… |
class WP_Block_Type { |
346 | 346 | * @param mixed $value Property value. |
347 | 347 | */ |
348 | 348 | public function __set( $name, $value ) { |
349 | | if ( ! in_array( $name, $this->deprecated_properties ) ) { |
| 349 | if ( ! in_array( $name, $this->deprecated_properties, true ) ) { |
350 | 350 | $this->{$name} = $value; |
351 | 351 | return; |
352 | 352 | } |
diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php
index 2852e23a93..013e0632a8 100644
a
|
b
|
if ( ! function_exists( 'get_avatar' ) ) : |
2879 | 2879 | $extra_attr .= "loading='{$loading}'"; |
2880 | 2880 | } |
2881 | 2881 | |
2882 | | if ( in_array( $args['decoding'], array( 'async', 'sync', 'auto' ) ) && ! preg_match( '/\bdecoding\s*=/', $extra_attr ) ) { |
| 2882 | if ( in_array( $args['decoding'], array( 'async', 'sync', 'auto' ), true ) && ! preg_match( '/\bdecoding\s*=/', $extra_attr ) ) { |
2883 | 2883 | if ( ! empty( $extra_attr ) ) { |
2884 | 2884 | $extra_attr .= ' '; |
2885 | 2885 | } |