Router returns false, but POST is not passed to requested resource

Bug #60159 Router returns false, but POST is not passed to requested resource
Submitted: 2011-10-28 16:21 UTC Modified: 2011-11-15 03:16 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: adam at sixohthree dot com Assigned: laruence (profile)
Status: Closed Package: Built-in web server
PHP Version: 5.4.0beta2 OS: Mac OS X 10.6.8
Private report: No CVE-ID: None

 [2011-10-28 16:21 UTC] adam at sixohthree dot com

Description:
------------
If the built-in web server's router returns false, and the requested resource is a 
PHP file, this PHP file will be interpreted but will not receive the same POST 
data as the router. I would expect the requested resource to receive POST, for 
cases when the router is only intended to handle files that do not exist (e.g. 
RewriteCond's !-f). WordPress requires this behavior, though I'm sure it's not 
alone.

Test script:
---------------
router.php:

<?php return false;

index.php:

<?php var_dump( $_POST );

Expected result:
----------------
# php -S localhost:8080 router.php
# curl -d foo=bar http://localhost:8080/
array(1) {
  ["foo"]=>
  string(3) "bar"
}

# php -S localhost:8080
# curl -d foo=bar http://localhost:8080/
array(1) {
  ["foo"]=>
  string(3) "bar"
}

Actual result:
--------------
# php -S localhost:8080 router.php
# curl -d foo=bar http://localhost:8080/
array(0) {
}

# php -S localhost:8080
# curl -d foo=bar http://localhost:8080/
array(1) {
  ["foo"]=>
  string(3) "bar"
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports

 [2011-11-15 03:16 UTC] laruence@php.net

-Status: Open +Status: Closed -Assigned To: +Assigned To: laruence