Serialize fix

This commit is contained in:
Chris Boden 2012-03-27 15:31:28 -04:00
parent 33ed96eba0
commit c58814ab64

View File

@ -12,6 +12,7 @@ class PhpHandler implements HandlerInterface {
/**
* {@inheritdoc}
* @link http://ca2.php.net/manual/en/function.session-decode.php#108037 Code from this comment on php.net
* @throws UnexpectedValueException If there is a problem parsing the data
*/
public function unserialize($raw) {
$returnData = array();
@ -19,7 +20,7 @@ class PhpHandler implements HandlerInterface {
while ($offset < strlen($raw)) {
if (!strstr(substr($raw, $offset), "|")) {
throw new Exception("invalid data, remaining: " . substr($raw, $offset));
throw new \UnexpectedValueException("invalid data, remaining: " . substr($raw, $offset));
}
$pos = strpos($raw, "|", $offset);