sapi_read_standard_form_data(TSRMLS_C);
}
- if (PG(always_populate_raw_post_data) && SG(request_info).post_data) {
+ /* For unknown content types we create HTTP_RAW_POST_DATA even if always_populate_raw_post_data off,
+ * this is in-effecient, but we need to keep doing it for BC reasons (for now) */
+ if ((PG(always_populate_raw_post_data) || NULL == SG(request_info).post_entry) && SG(request_info).post_data) {
length = SG(request_info).post_data_length;
data = estrndup(SG(request_info).post_data, length);
SET_VAR_STRINGL("HTTP_RAW_POST_DATA", data, length);
--- /dev/null
+--TEST--
+Registration of HTTP_RAW_POST_DATA due to unknown content-type
+--INI--
+magic_quotes_gpc=0
+always_populate_raw_post_data=0
+--SKIPIF--
+<?php if (php_sapi_name()=='cli') echo 'skip'; ?>
+--POST_RAW--
+Content-Type: unknown/type
+a=1&b=ZYX
+--FILE--
+<?php
+var_dump($_POST, $HTTP_RAW_POST_DATA);
+?>
+--EXPECT--
+array(0) {
+}
+string(10) "a=1&b=ZYX
+"
\ No newline at end of file