Skip to content

Commit 3240dd9

Browse files
committed
Merge branch 'PHP-5.6' into PHP-7.0
2 parents 159602b + 2d4ad66 commit 3240dd9

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 2016 PHP 7.0.5
44

5+
- CLI Server:
6+
. Fixed bug #69953 (Support MKCALENDAR request method). (Christoph)
7+
58
- Core:
69
. Fixed bug #71695 (Global variables are reserved before execution).
710
(Laruence)

sapi/cli/php_http_parser.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ static const char *method_strings[] =
8989
, "LOCK"
9090
, "MKCOL"
9191
, "MOVE"
92+
, "MKCALENDAR"
9293
, "PROPFIND"
9394
, "PROPPATCH"
9495
, "SEARCH"
@@ -585,7 +586,7 @@ size_t php_http_parser_execute (php_http_parser *parser,
585586
case 'G': parser->method = PHP_HTTP_GET; break;
586587
case 'H': parser->method = PHP_HTTP_HEAD; break;
587588
case 'L': parser->method = PHP_HTTP_LOCK; break;
588-
case 'M': parser->method = PHP_HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH */ break;
589+
case 'M': parser->method = PHP_HTTP_MKCOL; /* or MOVE, MKCALENDAR, MKACTIVITY, MERGE, M-SEARCH */ break;
589590
case 'N': parser->method = PHP_HTTP_NOTIFY; break;
590591
case 'O': parser->method = PHP_HTTP_OPTIONS; break;
591592
case 'P': parser->method = PHP_HTTP_POST; /* or PROPFIND or PROPPATCH or PUT */ break;
@@ -623,6 +624,8 @@ size_t php_http_parser_execute (php_http_parser *parser,
623624
} else if (parser->method == PHP_HTTP_MKCOL) {
624625
if (index == 1 && ch == 'O') {
625626
parser->method = PHP_HTTP_MOVE;
627+
} else if (index == 3 && ch == 'A') {
628+
parser->method = PHP_HTTP_MKCALENDAR;
626629
} else if (index == 1 && ch == 'E') {
627630
parser->method = PHP_HTTP_MERGE;
628631
} else if (index == 1 && ch == '-') {

sapi/cli/php_http_parser.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ enum php_http_method
8888
, PHP_HTTP_LOCK
8989
, PHP_HTTP_MKCOL
9090
, PHP_HTTP_MOVE
91+
, PHP_HTTP_MKCALENDAR
9192
, PHP_HTTP_PROPFIND
9293
, PHP_HTTP_PROPPATCH
9394
, PHP_HTTP_SEARCH

sapi/cli/tests/bug69655.phpt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ include "skipif.inc";
1010
<?php
1111
include "php_cli_server.inc";
1212
php_cli_server_start();
13-
foreach (['MKCALENDAR', 'MKCO', 'MKCOLL', 'M'] as $method) {
13+
foreach (['MKCO', 'MKCOLL', 'M'] as $method) {
1414
$context = stream_context_create(['http' => ['method' => $method]]);
1515
// the following is supposed to emit a warning for unsupported methods
1616
file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, false, $context);
@@ -25,6 +25,3 @@ Warning: file_get_contents(http://localhost:8964): failed to open stream: HTTP r
2525

2626
Warning: file_get_contents(http://localhost:8964): failed to open stream: HTTP request failed! HTTP/1.0 501 Not Implemented
2727
in %s on line %d
28-
29-
Warning: file_get_contents(http://localhost:8964): failed to open stream: HTTP request failed! HTTP/1.0 501 Not Implemented
30-
in %s on line %d

sapi/cli/tests/bug69953.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
FR #69953 (Support MKCALENDAR request method)
3+
--INI--
4+
allow_url_fopen=1
5+
--SKIPIF--
6+
<?php
7+
include "skipif.inc";
8+
?>
9+
--FILE--
10+
<?php
11+
include "php_cli_server.inc";
12+
php_cli_server_start('echo $_SERVER["REQUEST_METHOD"];');
13+
$context = stream_context_create(['http' => ['method' => 'MKCALENDAR']]);
14+
var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, false, $context));
15+
?>
16+
--EXPECT--
17+
string(10) "MKCALENDAR"

0 commit comments

Comments
 (0)