Explorar o código

[HttpFoundation] fixed a warning

Fabien Potencier %!s(int64=14) %!d(string=hai) anos
pai
achega
4c7adc2f12
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/Symfony/Component/HttpFoundation/HeaderBag.php

+ 4 - 0
src/Symfony/Component/HttpFoundation/HeaderBag.php

@@ -44,6 +44,10 @@ class HeaderBag
      */
     public function __toString()
     {
+        if (!$this->headers) {
+            return '';
+        }
+
         $beautifier = function ($name) {
             return preg_replace('/\-(.)/e', "'-'.strtoupper('\\1')", ucfirst($name));
         };