summaryrefslogtreecommitdiff
path: root/includes/templates
diff options
context:
space:
mode:
Diffstat (limited to 'includes/templates')
-rw-r--r--includes/templates/NoLocalSettings.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/includes/templates/NoLocalSettings.php b/includes/templates/NoLocalSettings.php
index 9001e3ba..facb6167 100644
--- a/includes/templates/NoLocalSettings.php
+++ b/includes/templates/NoLocalSettings.php
@@ -9,10 +9,17 @@
if ( !isset( $wgVersion ) ) {
$wgVersion = 'VERSION';
}
-$script = $_SERVER['SCRIPT_NAME'];
-$path = pathinfo( $script, PATHINFO_DIRNAME ) . '/';
-$path = str_replace( '//', '/', $path );
-$ext = pathinfo( $script, PATHINFO_EXTENSION );
+
+$matches = array();
+$ext = 'php';
+$path = '/';
+foreach( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) {
+ if( !preg_match( '/\.(php5?)$/', $part, $matches ) ) {
+ $path .= "$part/";
+ } else {
+ $ext = $matches[1] == 'php5' ? 'php5' : 'php';
+ }
+}
# Check to see if the installer is running
if ( !function_exists( 'session_name' ) ) {