* @file
*/
-# bug 30219 : can not use pathinfo() on URLs since slashes do not match
-$matches = array();
-$ext = 'php';
+# T32219 : can not use pathinfo() on URLs since slashes do not match
+$matches = [];
$path = '/';
foreach ( array_filter( explode( '/', $_SERVER['PHP_SELF'] ) ) as $part ) {
- if ( !preg_match( '/\.(php5?)$/', $part, $matches ) ) {
+ if ( !preg_match( '/\.(php)$/', $part, $matches ) ) {
$path .= "$part/";
} else {
- $ext = $matches[1] == 'php5' ? 'php5' : 'php';
break;
}
}
# Render error page if no LocalSettings file can be found
try {
+ global $wgVersion;
echo $templateParser->processTemplate(
'NoLocalSettings',
- array(
- 'wgVersion' => ( isset( $wgVersion ) ? $wgVersion : 'VERSION' ),
+ [
+ 'wgVersion' => ( $wgVersion ?? 'VERSION' ),
'path' => $path,
- 'ext' => $ext,
'localSettingsExists' => file_exists( MW_CONFIG_FILE ),
'installerStarted' => $installerStarted
- )
+ ]
);
} catch ( Exception $e ) {
echo 'Error: ' . htmlspecialchars( $e->getMessage() );