Modify maintenance/dev/ router code to fix the bug where post data gets discarded and you can't login inside the dev environment.

This commit is contained in:
Daniel Friesen 2011-11-24 08:41:57 +00:00
parent 53f5c13995
commit 750eac7e41

View 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" ) );