php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67198 php://input regression
Submitted: 2014-05-03 22:52 UTC Modified: 2014-05-06 09:29 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: bugzilla77 at gmail dot com Assigned: mike (profile)
Status: Closed Package: Streams related
PHP Version: 5.6.0beta2 OS: win 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bugzilla77 at gmail dot com
New email:
PHP Version: OS:

 

 [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]

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [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 09:29 UTC] mike@php.net
I'll look into it!
 [2014-05-06 10:37 UTC] mike@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7308d47c4b36403c4d5a37798446b1837090a683
Log: fix bug #67198 (php://input regression)
 [2014-05-06 10:37 UTC] mike@php.net
-Status: Assigned +Status: Closed
 [2014-05-06 10:37 UTC] mike@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=86b6bfb9b7ebfd96f034d8a44ae56628c10154c2
Log: fix bug #67198 (php://input regression)
 [2014-05-07 13:01 UTC] ab@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7308d47c4b36403c4d5a37798446b1837090a683
Log: fix bug #67198 (php://input regression)
 [2014-05-07 13:04 UTC] ab@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7308d47c4b36403c4d5a37798446b1837090a683
Log: fix bug #67198 (php://input regression)
 [2014-05-12 09:03 UTC] ab@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=86b6bfb9b7ebfd96f034d8a44ae56628c10154c2
Log: fix bug #67198 (php://input regression)
 [2014-05-13 11:25 UTC] dmitry@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=86b6bfb9b7ebfd96f034d8a44ae56628c10154c2
Log: fix bug #67198 (php://input regression)
 [2014-05-13 11:25 UTC] dmitry@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7308d47c4b36403c4d5a37798446b1837090a683
Log: fix bug #67198 (php://input regression)
 [2014-05-14 07:57 UTC] tyrael@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7308d47c4b36403c4d5a37798446b1837090a683
Log: fix bug #67198 (php://input regression)
 [2016-07-20 11:40 UTC] davey@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=86b6bfb9b7ebfd96f034d8a44ae56628c10154c2
Log: fix bug #67198 (php://input regression)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 13:01:30 2025 UTC