Safely unserialize base64 encoded data.
This helper decodes a base64 encoded string and attempts to unserialize it while applying several validation steps to reduce security risks.
Security improvements:
allowed_classes => false option.If the input cannot be decoded or is not a valid serialized value, the function safely returns false instead of attempting to unserialize it.
| Since | |
|---|---|
3.3.0 |
|
3.5.21 |
Hardened unserialize handling by enforcing strict base64 decoding, validating serialized input, and disabling object instantiation. |
| Parameters | |||
|---|---|---|---|
string
|
$data |
Base64 encoded serialized data. |
# |
| Returns | |
|---|---|
mixed|false
|
Returns the unserialized value on success, or false if the input is invalid or cannot be safely unserialized. |