WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/05/2019 01:54:43 PM (2 months ago)
Author:
SergeyBiryukov
Message:

General: Correctly detect large floats in is_serialized().

Props killerbishop, donmhico, hoythan.
Fixes #46570.

File:
1 edited

Legend:

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

    r45607 r45754  
    227227        foreach ( $not_serialized as $case ) {
    228228            $this->assertFalse( is_serialized( $case ), "Test data: $case" );
     229        }
     230    }
     231
     232    /**
     233     * @ticket 46570
     234     */
     235    function test_is_serialized_should_return_true_for_large_floats() {
     236        $cases = array(
     237            serialize( 1.7976931348623157E+308 ),
     238            serialize( array( 1.7976931348623157E+308, 1.23e50 ) )
     239        );
     240
     241        foreach ( $cases as $case ) {
     242            $this->assertTrue( is_serialized( $case ), "Serialized data: $case" );
    229243        }
    230244    }
Note: See TracChangeset for help on using the changeset viewer.