wizacode/php-error-proof-unserializer

last chance php unserializer

1.1 2022-05-11 18:59 UTC

This package is not auto-updated.

Last update: 2024-05-10 05:53:48 UTC


README

Intro

Notice:  unserialize(): Error at offset ... of ... bytes ...

You can try this to unserialize a corrupted serialized string.

Usage

use Wizacode\ErrorProofUnserializer\ErrorProofUnserializer;

// Attempt to unserialize a corrupted serialized string:

$recoveredUnserializedData = ErrorProofUnserializer::process($brokenSerializedString);

// Or only fix the serialized string:

$fixedSerializedData = ErrorProofUnserialize::fix($brokenSerializedString);

P.S.: Don't record php serialized data in a RDBMS (or use at least a binary safe storage type)