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

From: Date: Thu, 24 Sep 2015 23:51:38 +0000
Subject: Bug #70576 [Opn->Csd]: On PUT/PATCH Methods all PHP file methods can read php://input just one time
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196221@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70576&edit=1 ID: 70576 Updated by: requinix@php.net Reported by: chameleonbr at gmail dot com Summary: On PUT/PATCH Methods all PHP file methods can read php://input just one time -Status: Open +Status: Closed Type: Bug Package: Filesystem function related Operating System: OpenSUSE 13.2 PHP Version: 5.5.29 -Assigned To: +Assigned To: mike Block user comment: N Private report: N New Comment: This was fixed in PHP 5.6. 5.5 is now only receiving security fixes so please consider upgrading. Previous Comments: ------------------------------------------------------------------------ [2015-09-24 20:50:59] chameleonbr at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=70576&edit=1

« previous php.bugs (#196221) next »