php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
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
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: adam at sixohthree dot com
New email:
PHP Version: OS:

 

 [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:15 UTC] laruence@php.net
Automatic comment from SVN on behalf of laruence
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=319224
Log: Fixed bug #60159 (Router returns false, but POST is not passed to requested
resource) and bug #55759 (mem leak when use built-in server)
 [2011-11-15 03:16 UTC] laruence@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2011-11-15 03:16 UTC] laruence@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: laruence
 [2012-04-18 09:47 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f8503b4332dd27d2e60147e318212f9f6c39c3ce
Log: Fixed bug #60159 (Router returns false, but POST is not passed to requested resource) and bug #55759 (mem leak when use built-in server)
 [2012-07-24 23:38 UTC] rasmus@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f8503b4332dd27d2e60147e318212f9f6c39c3ce
Log: Fixed bug #60159 (Router returns false, but POST is not passed to requested resource) and bug #55759 (mem leak when use built-in server)
 [2013-11-17 09:35 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=f8503b4332dd27d2e60147e318212f9f6c39c3ce
Log: Fixed bug #60159 (Router returns false, but POST is not passed to requested resource) and bug #55759 (mem leak when use built-in server)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Nov 11 03:01:28 2024 UTC