: Bug #67198 :: php://input regression

 [2014-05-03 22:52 UTC] bugzilla77 at gmail dot com

Description:
------------
Please SET php.ini: enable_post_data_reading = Off

PHP.INI quote:

"the only way you will be able to read the POST data will be through the php://input stream wrapper"

PHP 5.6 b2 buggy
PHP 5.5.12 OK

Test script:
---------------
<?php
 if(!ini_get('enable_post_data_reading')){
  if($_SERVER['REQUEST_METHOD']=='POST'){
   exit(file_get_contents('php://input'));
  }
 }else{
  exit('Please SET php.ini: enable_post_data_reading = Off');
 }
?>
<script>
 ajax=new XMLHttpRequest()
 ajax.open('POST',location.href,false) // synchronous
 ajax.send('PASS')
 document.write(ajax.responseText)
</script>

Expected result:
----------------
PASS

Actual result:
--------------
[empty string]

 [2014-05-05 11:49 UTC] tyrael@php.net

-Status: Open +Status: Assigned -Assigned To: +Assigned To: mike

 [2014-05-05 11:49 UTC] tyrael@php.net

Mike, any chance you can test this report on windows?
I couldn't reproduce it on Mac Os or linux, so I guess it is a windows specific problem.
We can also try to ask Anatol for some help!

 [2014-05-05 11:52 UTC] bugzilla77 at gmail dot com

I use:

Apache 2.4.9 VC11
module php5apache2_4.dll

on win 7 32bit

 [2014-05-05 11:54 UTC] bugzilla77 at gmail dot com

PS When enable_post_data_reading = On 'php://input' stream consist POST data.

 [2014-05-05 11:54 UTC] tyrael@php.net

nope, I was able to reproduce when building with --enable-maintainer-zts (which should be an obvious thing to do as it is a windows report).

 [2014-05-05 14:28 UTC] tyrael@php.net

it seems the problem is only present on the second request, I've added a testcase: tests/basic/bug67198.phpt
that pass on 5.5 and fails on 5.6 and master

 [2014-05-06 09:29 UTC] mike@php.net

-Summary: REGRESION php://input +Summary: php://input regression

 [2014-05-06 10:37 UTC] mike@php.net

-Status: Assigned +Status: Closed