Fixes the OpenID response when there is no header to display.
authorVincent Zanotti <vincent.zanotti@m4x.org>
Thu, 30 Jul 2009 18:00:54 +0000 (20:00 +0200)
committerVincent Zanotti <vincent.zanotti@m4x.org>
Thu, 30 Jul 2009 18:00:54 +0000 (20:00 +0200)
Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org>
modules/openid/openid.inc.php

index 455e9df..ba70f2f 100644 (file)
@@ -203,8 +203,10 @@ class OpenId
             header(sprintf('%s %d', $_SERVER['SERVER_PROTOCOL'], $web_response->code),
                    true, $web_response->code);
 
-            foreach ($web_response->headers as $key => $value) {
-                header(sprintf('%s: %s', $key, $value));
+            if (count($web_response->headers) > 0) {
+                foreach ($web_response->headers as $key => $value) {
+                    header(sprintf('%s: %s', $key, $value));
+                }
             }
 
             header('Connection: close');