Prechádzať zdrojové kódy

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

Jordi Boggiano 14 rokov pred
rodič
commit
d28b9ddcda

+ 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]);
         }
     }