Make WordPress Core

Changeset 53822


Ignore:
Timestamp:
08/04/2022 12:35:28 PM (20 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r53821 r53822  
    6262            array( null, false ),
    6363            array( '', false ),
     64            array( 0.0, false ),
    6465            array( 0, true ),
    6566            array( 1, true ),
Note: See TracChangeset for help on using the changeset viewer.