Explorar el Código

[HttpFoundation] fixed a warning

Fabien Potencier hace 14 años
padre
commit
4c7adc2f12
Se han modificado 1 ficheros con 4 adiciones y 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));
         };