Bläddra i källkod

[RequestHandler] fixed cloning of Request instances

Fabien Potencier 15 år sedan
förälder
incheckning
1bce64678f
1 ändrade filer med 11 tillägg och 0 borttagningar
  1. 11 0
      src/Symfony/Components/RequestHandler/Request.php

+ 11 - 0
src/Symfony/Components/RequestHandler/Request.php

@@ -172,6 +172,17 @@ class Request
     return $dup;
   }
 
+  public function __clone()
+  {
+    $this->query   = clone $this->query;
+    $this->request = clone $this->request;
+    $this->path    = clone $this->path;
+    $this->cookies = clone $this->cookies;
+    $this->files   = clone $this->files;
+    $this->server  = clone $this->server;
+    $this->headers = clone $this->headers;
+  }
+
   // Order of precedence: GET, PATH, POST, COOKIE
   // Avoid using this method in controllers:
   //  * slow