com php-src: Fix #66606: Sets HTTP_CONTENT_TYPE but not CONTENT_TYPE: sapi/cli/php_cli_server.c
| From: | Christoph Michael Becker | Date: | Sun, 09 Aug 2015 00:37:16 +0000 |
| Subject: | com php-src: Fix #66606: Sets HTTP_CONTENT_TYPE but not CONTENT_TYPE: sapi/cli/php_cli_server.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88369@lists.php.net to get a copy of this message | ||
Commit: 72976e2497f963b7f203443f9881d52e0ff97962
Author: wusuopu <admin@longchangjin.cn> Mon, 3 Nov 2014 14:52:16 +0800
Committer: Christoph M. Becker <cmb@php.net> Sun, 9 Aug 2015 02:37:16 +0200
Parents: 1b4a80332c78045ac4a24208951f96fbd700825f
Branches: PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=72976e2497f963b7f203443f9881d52e0ff97962
Log:
Fix #66606: Sets HTTP_CONTENT_TYPE but not CONTENT_TYPE
The patch will store Content-Type header value in both HTTP_CONTENT_TYPE field and CONTENT_TYPE
field.
Bugs:
https://bugs.php.net/66606
Changed paths:
M sapi/cli/php_cli_server.c
Diff:
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c
index 3214a2b..0022678 100644
--- a/sapi/cli/php_cli_server.c
+++ b/sapi/cli/php_cli_server.c
@@ -732,6 +732,9 @@ static int sapi_cli_server_register_entry_cb(char **entry TSRMLS_DC, int num_arg
}
}
spprintf(&real_key, 0, "%s_%s", "HTTP", key);
+ if (strcmp(key, "CONTENT_TYPE") == 0 || strcmp(key, "CONTENT_LENGTH") == 0) {
+ sapi_cli_server_register_variable(track_vars_array, key, *entry TSRMLS_CC);
+ }
sapi_cli_server_register_variable(track_vars_array, real_key, *entry TSRMLS_CC);
efree(key);
efree(real_key);