X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FNoLocalSettings.php;h=f6f4cd3a3ef752e70154ac559975190958e5ae88;hb=d830ad1917c3665bc5362cac9703e4de9ae89add;hp=b0a6b7bd0499956298485849825259a03bc99290;hpb=bdfe02223205923d923923dd420ba0dd863cd0fe;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/NoLocalSettings.php b/includes/NoLocalSettings.php index b0a6b7bd04..f6f4cd3a3e 100644 --- a/includes/NoLocalSettings.php +++ b/includes/NoLocalSettings.php @@ -20,15 +20,13 @@ * @file */ -# bug 30219 : can not use pathinfo() on URLs since slashes do not match +# T32219 : can not use pathinfo() on URLs since slashes do not match $matches = []; -$ext = 'php'; $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; } } @@ -50,12 +48,12 @@ $templateParser = new TemplateParser(); # Render error page if no LocalSettings file can be found try { + global $wgVersion; echo $templateParser->processTemplate( 'NoLocalSettings', [ - 'wgVersion' => ( isset( $wgVersion ) ? $wgVersion : 'VERSION' ), + 'wgVersion' => ( $wgVersion ?? 'VERSION' ), 'path' => $path, - 'ext' => $ext, 'localSettingsExists' => file_exists( MW_CONFIG_FILE ), 'installerStarted' => $installerStarted ]