]> granicus.if.org Git - php/commitdiff
Make http_response_code() return FALSE where data is not available (Ex. cli sapi)
authorIlia Alshanetsky <iliaa@php.net>
Tue, 10 Aug 2010 00:19:51 +0000 (00:19 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 10 Aug 2010 00:19:51 +0000 (00:19 +0000)
ext/standard/head.c

index 7c0192c4cb34740d62ab66d5c31de3fb69579d34..a9ae420900650b1e3cf43bc695ab785235b336a8 100644 (file)
@@ -289,6 +289,10 @@ PHP_FUNCTION(http_response_code)
                return;
        }
 
+       if (!SG(sapi_headers).http_response_code) {
+               RETURN_FALSE;
+       }
+
        RETURN_LONG(SG(sapi_headers).http_response_code);
 }
 /* }}} */