com php-src: Merge branch 'PHP-5.5' into PHP-5.6: NEWS sapi/cli/php_cli_server.c sapi/cli/tests/bug674 29.phpt
| From: | Adam Harvey | Date: | Fri, 13 Jun 2014 00:57:36 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.5' into PHP-5.6: NEWS sapi/cli/php_cli_server.c sapi/cli/tests/bug674 29.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78863@lists.php.net to get a copy of this message | ||
Commit: e082199d8ed1fec9ea69e2129ae08584ee3b66dd
Author: Adam Harvey <aharvey@php.net> Thu, 12 Jun 2014 17:57:36 -0700
Parents: 82231b5d895b67652c14ecb0ffddc8239777c175 e956ba935765c410195a3d402aa9456d187472d6
Branches: PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e082199d8ed1fec9ea69e2129ae08584ee3b66dd
Log:
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
Add 308 and 426 to the HTTP response code map in the CLI server.
Changed paths:
MM NEWS
MM sapi/cli/php_cli_server.c
AM sapi/cli/tests/bug67429.phpt
Diff:
diff --cc NEWS
index bd82cae,79d6501..1adc56b
--- a/NEWS
+++ b/NEWS
@@@ -9,11 -18,19 +9,15 @@@ PH
(static::) in some cases). (Levi Morrison)
. Fixed bug #67390 (insecure temporary file use in the configure script).
(Remi) (CVE-2014-3981)
- . Fixed bug #67399 (putenv with empty variable may lead to crash). (Stas)
+ . Fixed bug #67392 (dtrace breaks argument unpack). (Nikita)
+ . Fixed bug #67428 (header('Location: foo') will override a 308-399 response
+ code). (Adam)
+ - CLI server:
- . Fixed Bug #67406i (built-in web-server segfaults on startup). (Remi)
-
-- Date:
- . Fixed bug #67308 (Serialize of DateTime truncates fractions of second).
++ . Implemented FR #67429 (CLI server is missing some new HTTP response codes).
+ (Adam)
- . Fixed regression in fix for bug #67118 (constructor can't be called twice).
- (Remi)
+
- Fileinfo:
- . Fixed bug #67326 (fileinfo: cdf_read_short_sector insufficient boundary check)..
. Fixed bug #67410 (fileinfo: mconvert incorrect handling of truncated pascal
string size). (Francisco Alonso, Jan Kaluza, Remi)
. Fixed bug #67411 (fileinfo: cdf_check_stream_offset insufficient boundary
diff --cc sapi/cli/tests/bug67429.phpt
index 0000000,59486db..856946b
mode 000000,100644..100644
--- a/sapi/cli/tests/bug67429.phpt
+++ b/sapi/cli/tests/bug67429.phpt
@@@ -1,0 -1,49 +1,49 @@@
+ --TEST--
+ FR #67429 (CLI server is missing some new HTTP response codes)
+ --SKIPIF--
+ <?php
+ include "skipif.inc";
+ ?>
+ --FILE--
+ <?php
+ include "php_cli_server.inc";
+
+ foreach ([308, 426] as $code) {
+ php_cli_server_start(<<<PHP
+ http_response_code($code);
+ PHP
+ );
+
+ list($host, $port) = explode(':', PHP_CLI_SERVER_ADDRESS);
+ $port = intval($port)?:80;
+
+ $fp = fsockopen($host, $port, $errno, $errstr, 0.5);
+ if (!$fp) {
+ die("connect failed");
+ }
+
+ if(fwrite($fp, <<<HEADER
+ GET / HTTP/1.1
+
+
+ HEADER
+ )) {
+ while (!feof($fp)) {
+ echo fgets($fp);
+ }
+ }
+
+ fclose($fp);
+ }
+ ?>
+ --EXPECTF--
+ HTTP/1.1 308 Permanent Redirect
+ Connection: close
+ X-Powered-By: %s
-Content-type: text/html
++Content-type: text/html; charset=UTF-8
+
+ HTTP/1.1 426 Upgrade Required
+ Connection: close
+ X-Powered-By: %s
-Content-type: text/html
++Content-type: text/html; charset=UTF-8
+