http://www.mediawiki.org/wiki/Special:Code/MediaWiki/94171

Revision: 94171
Author:   demon
Date:     2011-08-10 17:28:25 +0000 (Wed, 10 Aug 2011)
Log Message:
-----------
(bug 30219) NoLocalSettings.php broken on Windows servers. Per Tim on r70711, 
can't use pathinfo() on url's since the slashes don't match.

Modified Paths:
--------------
    trunk/phase3/includes/templates/NoLocalSettings.php

Modified: trunk/phase3/includes/templates/NoLocalSettings.php
===================================================================
--- trunk/phase3/includes/templates/NoLocalSettings.php 2011-08-10 17:12:50 UTC 
(rev 94170)
+++ trunk/phase3/includes/templates/NoLocalSettings.php 2011-08-10 17:28:25 UTC 
(rev 94171)
@@ -9,11 +9,18 @@
 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' ) ) {
        $installerStarted = false;


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to