From a644516c5c4eae0f466be0517dc1fb3763858a1b Mon Sep 17 00:00:00 2001 From: Aleksey Podskrebyshev Date: Fri, 10 May 2013 16:58:21 +0400 Subject: [PATCH] [HttpFoundation][NamespacedAttributeBag] Refactoring of resolveKey() method --- .../Session/Attribute/NamespacedAttributeBag.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;