Fix PHP warning related to logging severity threshold (#43448)

* Fix PHP warning related to logging default severity threshold

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Jorge A. Torres 2024-01-10 13:32:35 +00:00 committed by GitHub
parent a6705cda15
commit 39ec01bceb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Comment: Fixes a PHP deprecation warning introduced in PR-42979.

View File

@ -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 );
}
/**