Bug #70576 [NEW]: On PUT/PATCH Methods all PHP file methods can read php://input just one time

From: Date: Thu, 24 Sep 2015 20:51:02 +0000
Subject: Bug #70576 [NEW]: On PUT/PATCH Methods all PHP file methods can read php://input just one time
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196219@lists.php.net to get a copy of this message
From: chameleonbr at gmail dot com Operating system: OpenSUSE 13.2 PHP version: 5.5.29 Package: Filesystem function related Bug Type: Bug Bug description:On PUT/PATCH Methods all PHP file methods can read php://input just one time Description: ------------ On HTTP PUT and PATCH Methods all PHP file methods can read php://input just one time. In the method post 2 times the value appears as expected, but the put and patch methods returns only one time. Test script: --------------- <?php var_dump(file_get_contents('php://input')); var_dump(file_get_contents('php://input')); ?> Send DATA using HTTP POST and after HTTP PUT or PATCH. Actual result: -------------- curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d 'var1=val2&var2=val2' 'http://localhost/testmethod.php' result: string(19) "var1=val2&var2=val2" string(19) "var1=val2&var2=val2" curl -X PUT -H "Content-Type: application/x-www-form-urlencoded" -d 'var1=val2&var2=val2' 'http://localhost/testmethod.php' result: string(19) "var1=val2&var2=val2" string(0) "" curl -X PATCH -H "Content-Type: application/x-www-form-urlencoded" -d 'var1=val2&var2=val2' 'http://localhost/testmethod.php' result: string(19) "var1=val2&var2=val2" string(0) "" -- Edit bug report at https://bugs.php.net/bug.php?id=70576&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70576&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70576&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70576&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=70576&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=70576&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=70576&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=70576&r=needscript Try newer version: https://bugs.php.net/fix.php?id=70576&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=70576&r=support Expected behavior: https://bugs.php.net/fix.php?id=70576&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=70576&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=70576&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=70576&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70576&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=70576&r=dst IIS Stability: https://bugs.php.net/fix.php?id=70576&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=70576&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=70576&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=70576&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=70576&r=mysqlcfg

« previous php.bugs (#196219) next »