(bug 10398) Honour .php5 script extensions in pre-installation splash screen
[lhc/web/wiklou.git] / includes / templates / NoLocalSettings.php
1 <?php
2 # Prevent XSS
3 if ( isset( $wgVersion ) ) {
4 $wgVersion = htmlspecialchars( $wgVersion );
5 } else {
6 $wgVersion = 'VERSION';
7 }
8 # Set the path in case we hit a page such as /index.php/Main_Page
9 # Could use <base href> but then we have to worry about http[s]/port #/etc.
10 $ext = strpos( $_SERVER['SCRIPT_NAME'], 'index.php5' ) === false ? 'php' : 'php5';
11 $path = '';
12 if( isset( $_SERVER['SCRIPT_NAME'] )) {
13 $path = htmlspecialchars( preg_replace('/index.php5?/', '', $_SERVER['SCRIPT_NAME']) );
14 }
15 ?>
16 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
17 <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
18 <head>
19 <title>MediaWiki <?php echo $wgVersion ?></title>
20 <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
21 <style type='text/css' media='screen, projection'>
22 html, body {
23 color: #000;
24 background-color: #fff;
25 font-family: sans-serif;
26 text-align: center;
27 }
28
29 h1 {
30 font-size: 150%;
31 }
32 </style>
33 </head>
34 <body>
35 <img src="<?php echo $path ?>skins/common/images/mediawiki.png" alt='The MediaWiki logo' />
36
37 <h1>MediaWiki <?php echo $wgVersion ?></h1>
38 <div class='error'>
39 <?php
40 if ( file_exists( 'config/LocalSettings.php' ) ) {
41 echo( 'To complete the installation, move <tt>config/LocalSettings.php</tt> to the parent directory.' );
42 } else {
43 echo( "Please <a href=\"${path}config/index.{$ext}\" title='setup'> set up the wiki</a> first." );
44 }
45 ?>
46
47 </div>
48 </body>
49 </html>