From: Chad Horohoe Date: Wed, 10 Aug 2011 17:28:25 +0000 (+0000) Subject: (bug 30219) NoLocalSettings.php broken on Windows servers. Per Tim on r70711, can... X-Git-Tag: 1.31.0-rc.0~28374 X-Git-Url: http://git.cyclocoop.org/%22%20.%20%20%20%24self2%20.%20%20%20%22&var_mode_affiche=boucle?a=commitdiff_plain;h=949a2ecb3b66c35a27e37794d51c6dccbbdf5f68;p=lhc%2Fweb%2Fwiklou.git (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. --- diff --git a/includes/templates/NoLocalSettings.php b/includes/templates/NoLocalSettings.php index 9001e3ba8e..facb616779 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' ) ) {