summaryrefslogtreecommitdiff
path: root/ext/mbstring/mb_gpc.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2013-12-15 16:55:29 +0800
committerXinchen Hui <laruence@gmail.com>2013-12-15 16:55:29 +0800
commit5eb8d9d70009c0bf9bfbbf511f2713e64dc8ee83 (patch)
tree2480a26e79d85b4b7f2eacb5a2187eb13f029094 /ext/mbstring/mb_gpc.c
parent10964b78548a5878254f5aa75f4cfdcedb0543bc (diff)
parent904721189ff949c67795ec418f04b67951cbd57b (diff)
downloadphp-git-5eb8d9d70009c0bf9bfbbf511f2713e64dc8ee83.tar.gz
Merge branch 'PHP-5.6' of https://git.php.net/push/php-src into PHP-5.6
Diffstat (limited to 'ext/mbstring/mb_gpc.c')
-rw-r--r--ext/mbstring/mb_gpc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/mbstring/mb_gpc.c b/ext/mbstring/mb_gpc.c
index 5ecc8f365e..30764dc807 100644
--- a/ext/mbstring/mb_gpc.c
+++ b/ext/mbstring/mb_gpc.c
@@ -364,6 +364,7 @@ SAPI_POST_HANDLER_FUNC(php_mb_post_handler)
{
const mbfl_encoding *detected;
php_mb_encoding_handler_info_t info;
+ char *post_data_str = NULL;
MBSTRG(http_input_identify_post) = NULL;
@@ -376,7 +377,10 @@ SAPI_POST_HANDLER_FUNC(php_mb_post_handler)
info.num_from_encodings = MBSTRG(http_input_list_size);
info.from_language = MBSTRG(language);
- detected = _php_mb_encoding_handler_ex(&info, arg, SG(request_info).post_data TSRMLS_CC);
+ php_stream_rewind(SG(request_info).request_body);
+ php_stream_copy_to_mem(SG(request_info).request_body, &post_data_str, PHP_STREAM_COPY_ALL, 0);
+ detected = _php_mb_encoding_handler_ex(&info, arg, post_data_str TSRMLS_CC);
+ STR_FREE(post_data_str);
MBSTRG(http_input_identify) = detected;
if (detected) {