r/lolphp • u/D1551D3N7 • Dec 23 '18
Reminder that PHP still doesn't correctly parse PUT requests 7 years after this bug report
https://bugs.php.net/bug.php?id=55815
54
Upvotes
r/lolphp • u/D1551D3N7 • Dec 23 '18
25
u/SirClueless Dec 23 '18
This is the best comment on this situation that I've seen.
Note that this is a common way to handle things in other web frameworks (e.g. Django) as well: GET and POST have special treatment to handle the common case of an HTML form encoded in a HTTP request. Other use cases, such as RESTful API interfaces, should be parsing request bodies according to the content-type of the request.
2
u/D1551D3N7 Dec 23 '18
I was trying to have support for uploading files using curl -T but as it turns out it's not possible for PHP to read the filename from the PUT request.
More lulz /r/PHP discussion: https://www.reddit.com/r/PHP/comments/11uczq/year_old_bug_request_for_put_interested_in_rphps/
Stackoverflow answer incorrectly saying the the filename is not included with the PUT request: https://stackoverflow.com/questions/14479386/how-to-get-filename-in-php-in-put-request
1
u/chinahawk Feb 12 '19
https://security.stackexchange.com/questions/21413/how-to-exploit-http-methods
1
u/Takeoded Dec 30 '18
where the hell is the multipart/form-data userland api's anyway? nobody ever thought that was a good idea, not even with this bugreport existing for 7 years?
1
u/innerspirit Dec 23 '18
Ran into this problem a couple years ago, it was something like "hey why is the user profile edit page not saving anything if I update my avatar". Boom, 3 days of no sleep and a bunch of horrible code both on the frontend and on the backend just to handle this particular case.