Make WordPress Core

Changeset 53834


Ignore:
Timestamp:
08/04/2022 05:31:45 PM (2 weeks ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/cache.php

    r53831 r53834  
    6262            array( false, false ),
    6363            array( null, false ),
     64            array( "\n", false ),
     65            array( "\0", false ),
    6466            array( '', false ),
     67            array( ' ', false ),
     68            array( '  ', false ),
    6569            array( 0.0, false ),
    6670            array( 0, true ),
Note: See TracChangeset for help on using the changeset viewer.