From: Antoine Musso Date: Fri, 23 Mar 2018 10:38:26 +0000 (+0100) Subject: Let built-in web server handle .php requests X-Git-Tag: 1.31.0-rc.0~261^2 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=830dec6d21cb815f6552f2788b5f4f7230644f01;hp=6f9c30c67b31b12d39f2d54b431e141869895eca;p=lhc%2Fweb%2Fwiklou.git Let built-in web server handle .php requests When using the PHP built-in webserver with maintenance/dev/start.sh, requests made to regular files do show in the console output but requests to .php files do not log anything in the console. It is a bit annoying since one is left wondering whether the requests are actually honored. The reason is the request router maintenance/dev/includes/router.php does a require of the PHP file and abort the router (return true). That causes the built-in php server to not produce the access log requests. Based on the comment note, some earlier PHP version had POST data stripped preventing login. The related upstream bug is https://bugs.php.net/bug.php?id=60159: "Router returns false, but POST is not passed to requested resource" 750eac7e41d introduced the workaround on Nov 24th 2011. PHP 5.4.0 got released in March 2012 and refers to that bug. The development of our router thus must have used a development/beta version of PHP 5.4. Since the fix made it to the PHP final release, there is no need for workaround anymore. Bug: T190503 Change-Id: Ia8c4f1610ea0ef5b04ea30d6e91199b8e597065b --- diff --git a/maintenance/dev/includes/router.php b/maintenance/dev/includes/router.php index 77b0e61079..9917a4fa08 100644 --- a/maintenance/dev/includes/router.php +++ b/maintenance/dev/includes/router.php @@ -54,13 +54,7 @@ if ( !is_readable( $file ) ) { } $ext = pathinfo( $file, PATHINFO_EXTENSION ); if ( $ext == 'php' || $ext == 'php5' ) { - # Execute php files - # We use require and return true here because when you return false - # the php webserver will discard post data and things like login - # will not function in the dev environment. - require $file; - - return true; + return false; } $mime = false; // Borrow mime type file from MimeAnalyzer