mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Tests: Add more test cases 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, a string that becomes empty after `trim()` should not be considered a valid cache key. Follow-up to [53818], [53821], [53822]. Props tillkruess. See #56198. git-svn-id: https://develop.svn.wordpress.org/trunk@53834 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d1b3e1cfd4
commit
74c8b7f2de
@ -61,7 +61,11 @@ class Tests_Cache extends WP_UnitTestCase {
|
||||
return array(
|
||||
array( false, false ),
|
||||
array( null, false ),
|
||||
array( "\n", false ),
|
||||
array( "\0", false ),
|
||||
array( '', false ),
|
||||
array( ' ', false ),
|
||||
array( ' ', false ),
|
||||
array( 0.0, false ),
|
||||
array( 0, true ),
|
||||
array( 1, true ),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user