r104137 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104136‎ | r104137 | r104138 >
Date:08:41, 24 November 2011
Author:dantman
Status:ok
Tags:
Comment:
Modify maintenance/dev/ router code to fix the bug where post data gets discarded and you can't login inside the dev environment.
Modified paths:
  • /trunk/phase3/maintenance/dev/router.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/dev/router.php
@@ -1,5 +1,8 @@
22 <?php
33
 4+ini_set('display_errors', 1);
 5+error_reporting(E_ALL);
 6+
47 if ( isset( $_SERVER["SCRIPT_FILENAME"] ) ) {
58 $file = $_SERVER["SCRIPT_FILENAME"];
69 if ( !is_readable( $file ) ) {
@@ -7,9 +10,13 @@
811 return false;
912 }
1013 $ext = pathinfo( $file, PATHINFO_EXTENSION );
11 - if ( $ext == 'php' ) {
12 - # Let it execute php files
13 - return false;
 14+ if ( $ext == 'php' || $ext == 'php5' ) {
 15+ # Execute php files
 16+ # We use require and return true here because when you return false
 17+ # the php webserver will discard post data and things like login
 18+ # will not function in the dev environment.
 19+ require $file;
 20+ return true;
1421 }
1522 $mime = false;
1623 $lines = explode( "\n", file_get_contents( "includes/mime.types" ) );

Status & tagging log