From c58814ab646df460b41984eb0ad64fb8f657cb94 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Tue, 27 Mar 2012 15:31:28 -0400 Subject: [PATCH] Serialize fix --- src/Ratchet/Component/Session/Serialize/PhpHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Ratchet/Component/Session/Serialize/PhpHandler.php b/src/Ratchet/Component/Session/Serialize/PhpHandler.php index 1922fde..4bc2102 100644 --- a/src/Ratchet/Component/Session/Serialize/PhpHandler.php +++ b/src/Ratchet/Component/Session/Serialize/PhpHandler.php @@ -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);