diff --git a/plugins/woocommerce/changelog/43448-fix-logging-php-deprecated-warning b/plugins/woocommerce/changelog/43448-fix-logging-php-deprecated-warning new file mode 100644 index 00000000000..638e3788fff --- /dev/null +++ b/plugins/woocommerce/changelog/43448-fix-logging-php-deprecated-warning @@ -0,0 +1,4 @@ +Significance: patch +Type: fix +Comment: Fixes a PHP deprecation warning introduced in PR-42979. + diff --git a/plugins/woocommerce/includes/class-wc-log-levels.php b/plugins/woocommerce/includes/class-wc-log-levels.php index 80ca513ebfc..19737d9e066 100644 --- a/plugins/woocommerce/includes/class-wc-log-levels.php +++ b/plugins/woocommerce/includes/class-wc-log-levels.php @@ -78,7 +78,7 @@ abstract class WC_Log_Levels { * @return bool True if $level is a valid level. */ public static function is_valid_level( $level ) { - return array_key_exists( strtolower( $level ), self::$level_to_severity ); + return is_string( $level ) && array_key_exists( strtolower( $level ), self::$level_to_severity ); } /**