From: Ilia Alshanetsky Date: Tue, 10 Aug 2010 00:19:51 +0000 (+0000) Subject: Make http_response_code() return FALSE where data is not available (Ex. cli sapi) X-Git-Tag: php-5.4.0alpha1~191^2~1120 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=57ff563262a97fec1d545c6bce15406a174e0b23;p=php Make http_response_code() return FALSE where data is not available (Ex. cli sapi) --- diff --git a/ext/standard/head.c b/ext/standard/head.c index 7c0192c4cb..a9ae420900 100644 --- a/ext/standard/head.c +++ b/ext/standard/head.c @@ -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); } /* }}} */