X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24ze_article%22%29%20.%20%22?a=blobdiff_plain;f=includes%2FNoLocalSettings.php;h=46e9630f3497dae06c5c42c0659ca0185ebe57f3;hb=2486771b5dbf63f74bdf32844a404a1f85941245;hp=d299ab6ff5dbe4b37631e77b3c25aff344150c5c;hpb=5b1d551953623ed153225ebdfa630dba98536aca;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/NoLocalSettings.php b/includes/NoLocalSettings.php index d299ab6ff5..46e9630f34 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 -$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; } } @@ -50,15 +48,15 @@ $templateParser = new TemplateParser(); # Render error page if no LocalSettings file can be found try { + global $wgVersion; echo $templateParser->processTemplate( 'NoLocalSettings', - array( + [ 'wgVersion' => ( isset( $wgVersion ) ? $wgVersion : 'VERSION' ), 'path' => $path, - 'ext' => $ext, 'localSettingsExists' => file_exists( MW_CONFIG_FILE ), 'installerStarted' => $installerStarted - ) + ] ); } catch ( Exception $e ) { echo 'Error: ' . htmlspecialchars( $e->getMessage() );