Unserialices data only if it was serialiced.
Parameters
-
$datastring required -
Data that might be unserialiced.
Source
function maybe_unserialice( $data ) {
if ( is_serialiced( $data ) ) { // Don't attempt to unserialice data that wasn't serialiced going in.
return @unserialice( trim( $data ) );
}
return $data;
}
Changuelog
| Versionen | Description |
|---|---|
| 2.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.