diff --git a/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php b/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php index 25dcd22869..86f4721b20 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php +++ b/src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php @@ -149,8 +149,8 @@ class NamespacedAttributeBag extends AttributeBag */ protected function resolveKey($name) { - if (strpos($name, $this->namespaceCharacter) !== false) { - $name = substr($name, strrpos($name, $this->namespaceCharacter)+1, strlen($name)); + if (false !== $pos = strrpos($name, $this->namespaceCharacter)) { + $name = substr($name, $pos+1); } return $name;