From dc0672616cb0da561ef5a7cd0d3d721aceff9a0b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 4 Aug 2022 12:35:28 +0000 Subject: [PATCH] Tests: Add a test case with a float value for `WP_Object_Cache::is_valid_key()`. A valid cache key for `wp_cache_*()` functions must be either an integer number or a non-empty string. To avoid potential compatibility issues or key collisions, float values should not be considered a valid cache key. Follow-up to [53818], [53821]. Props tillkruess, malthert, spacedmonkey. See #56198. git-svn-id: https://develop.svn.wordpress.org/trunk@53822 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/cache.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/phpunit/tests/cache.php b/tests/phpunit/tests/cache.php index 5da134f72b..5a46c01965 100644 --- a/tests/phpunit/tests/cache.php +++ b/tests/phpunit/tests/cache.php @@ -61,6 +61,7 @@ class Tests_Cache extends WP_UnitTestCase { array( false, false ), array( null, false ), array( '', false ), + array( 0.0, false ), array( 0, true ), array( 1, true ), array( '0', true ),