]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.5' into PHP-5.6
authorAdam Harvey <aharvey@php.net>
Fri, 13 Jun 2014 00:57:36 +0000 (17:57 -0700)
committerAdam Harvey <aharvey@php.net>
Fri, 13 Jun 2014 00:57:36 +0000 (17:57 -0700)
* PHP-5.5:
  Add 308 and 426 to the HTTP response code map in the CLI server.

1  2 
NEWS
sapi/cli/php_cli_server.c
sapi/cli/tests/bug67429.phpt

diff --cc NEWS
index bd82caeb9f356e37abc518d5cbaa453d678d0dc2,79d65010f6fc3d5f2f72426011c5c9491c3cbb9c..1adc56b15fd78403cc7b5e7751200cfd9d60de2b
--- 1/NEWS
--- 2/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)
  
 -  . Fixed Bug #67406i (built-in web-server segfaults on startup). (Remi)
 -
 -- Date:
 -  . Fixed bug #67308 (Serialize of DateTime truncates fractions of second).
+ - CLI server:
 -  . Fixed regression in fix for bug #67118 (constructor can't be called twice).
 -    (Remi)
++  . Implemented FR #67429 (CLI server is missing some new HTTP response codes).
+     (Adam)
  - 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
Simple merge
index 0000000000000000000000000000000000000000,59486dbc0e14949b8972f056d6d37c57e8300672..856946b29dac81fd16771009b075d7a100f8ea3a
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,49 +1,49 @@@
 -Content-type: text/html
+ --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; charset=UTF-8