Make WordPress Core


Ignore:
Timestamp:
03/13/2020 09:12:01 PM (5 years ago)
Author:
SergeyBiryukov
Message:

General: Trim the input data in maybe_unserialize(), for consistency with is_serialized().

Props pbearne, mikeschroder.
Fixes #36416.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r47453 r47454  
    617617function maybe_unserialize( $data ) {
    618618    if ( is_serialized( $data ) ) { // Don't attempt to unserialize data that wasn't serialized going in.
    619         return @unserialize( $data );
     619        return @unserialize( trim( $data ) );
    620620    }
    621621
Note: See TracChangeset for help on using the changeset viewer.