浏览代码

[HttpFoundation] Fix session::remove() not initializing the session

Jordi Boggiano 14 年之前
父节点
当前提交
d28b9ddcda
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      src/Symfony/Component/HttpFoundation/Session.php

+ 3 - 4
src/Symfony/Component/HttpFoundation/Session.php

@@ -150,11 +150,10 @@ class Session implements \Serializable
      */
     public function remove($name)
     {
+        if (false === $this->started) {
+            $this->start();
+        }
         if (array_key_exists($name, $this->attributes)) {
-            if (false === $this->started) {
-                $this->start();
-            }
-
             unset($this->attributes[$name]);
         }
     }