Modify maintenance/dev/ router code to fix the bug where post data gets discarded...
authorDaniel Friesen <dantman@users.mediawiki.org>
Thu, 24 Nov 2011 08:41:57 +0000 (08:41 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Thu, 24 Nov 2011 08:41:57 +0000 (08:41 +0000)
maintenance/dev/router.php

index a35e217..ca5c410 100644 (file)
@@ -1,5 +1,8 @@
 <?php
 
+ini_set('display_errors', 1);
+error_reporting(E_ALL);
+
 if ( isset( $_SERVER["SCRIPT_FILENAME"] ) ) {
        $file = $_SERVER["SCRIPT_FILENAME"];
        if ( !is_readable( $file ) ) {
@@ -7,9 +10,13 @@ if ( isset( $_SERVER["SCRIPT_FILENAME"] ) ) {
                return false;
        }
        $ext = pathinfo( $file, PATHINFO_EXTENSION );
-       if ( $ext == 'php' ) {
-               # Let it execute php files
-               return false;
+       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;
        }
        $mime = false;
        $lines = explode( "\n", file_get_contents( "includes/mime.types" ) );