From a22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 09:20:55 +0100 Subject: Update to MediaWiki 1.17.1 --- includes/templates/NoLocalSettings.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'includes/templates') 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' ) ) { -- cgit v1.2.2