(bug 30219) NoLocalSettings.php broken on Windows servers. Per Tim on r70711, can...
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 10 Aug 2011 17:28:25 +0000 (17:28 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 10 Aug 2011 17:28:25 +0000 (17:28 +0000)
includes/templates/NoLocalSettings.php

index 9001e3b..facb616 100644 (file)
@@ -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' ) ) {