Quellcode durchsuchen

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

Jordi Boggiano vor 14 Jahren
Ursprung
Commit
d28b9ddcda
1 geänderte Dateien mit 3 neuen und 4 gelöschten Zeilen
  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]);
         }
     }