diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 09:20:55 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 09:20:55 +0100 |
commit | a22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (patch) | |
tree | 31882fdc36540fecfd62e5011fc38515e504a3db /includes/templates/NoLocalSettings.php | |
parent | 6ca0c5e0a943b64b4e3d0a11a80c5679f7252e64 (diff) |
Update to MediaWiki 1.17.1
Diffstat (limited to 'includes/templates/NoLocalSettings.php')
-rw-r--r-- | includes/templates/NoLocalSettings.php | 15 |
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' ) ) { |