(bug 10398) Honour .php5 script extensions in pre-installation splash screen
authorRob Church <robchurch@users.mediawiki.org>
Thu, 28 Jun 2007 16:06:32 +0000 (16:06 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Thu, 28 Jun 2007 16:06:32 +0000 (16:06 +0000)
includes/templates/NoLocalSettings.php

index e71dd39..9020c46 100644 (file)
@@ -7,9 +7,10 @@ if ( isset( $wgVersion ) ) {
 }
 # Set the path in case we hit a page such as /index.php/Main_Page
 # Could use <base href> but then we have to worry about http[s]/port #/etc.
+$ext = strpos( $_SERVER['SCRIPT_NAME'], 'index.php5' ) === false ? 'php' : 'php5';
 $path = '';
 if( isset( $_SERVER['SCRIPT_NAME'] )) {
-       $path = htmlspecialchars( preg_replace('/index.php/', '', $_SERVER['SCRIPT_NAME']) );
+       $path = htmlspecialchars( preg_replace('/index.php5?/', '', $_SERVER['SCRIPT_NAME']) );
 }
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -39,7 +40,7 @@ if( isset( $_SERVER['SCRIPT_NAME'] )) {
                if ( file_exists( 'config/LocalSettings.php' ) ) {
                        echo( 'To complete the installation, move <tt>config/LocalSettings.php</tt> to the parent directory.' );
                } else {
-                       echo( "Please <a href=\"${path}config/index.php\" title='setup'> set up the wiki</a> first." );
+                       echo( "Please <a href=\"${path}config/index.{$ext}\" title='setup'> set up the wiki</a> first." );
                }
                ?>