Przeglądaj źródła

[HttpFoundation] fixed a warning

Fabien Potencier 14 lat temu
rodzic
commit
4c7adc2f12

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