forked from miraheze/mw-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MissingWiki.php
78 lines (77 loc) · 3.16 KB
/
MissingWiki.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
if ( !in_array( $wgDBname, $wgLocalDatabases ) && !$wgCommandLineMode ) {
header( "HTTP/1.0 404 Not Found" );
$requestURL = htmlspecialchars( $_SERVER['REQUEST_URI'] );
date_default_timezone_set( 'UTC' ); // Set to UTC +0
$fullTimestamp = date( 'Y-m-d H:i:s' );
echo <<<EOF
<html>
<head>
<style type="text/css">
html, body {
height: 100%;
margin: 0;
padding: 0;
font-family: sans-serif;
}
html {
font-size: 100%;
}
body {
background-color: hsl(0, 0%, 96%);
}
h1, h2 {
margin-bottom: .6em !important;
}
h1 {
font-size: 188%;
}
h1, h2, h3, h4, h5, h6 {
color: hsl(0, 0%, 0%);
background: none;
font-weight: normal;
margin: 0;
overflow: hidden;
padding-top: .5em;
padding-bottom: .17em;
border-bottom: 1px solid hsl(0, 0%, 67%);
}
p {
margin: .4em 0 .5em 0;
}
</style>
</head>
<body>
<div style="text-align: center;">
<h1>404 Wiki Not Found</h1>
<p>The wiki you wanted to visit does not exist. Please be sure you typed the URL correctly.</p>
<p>You can find all of our existing wikis <a href="https://meta.miraheze.org/wiki/Special:SiteMatrix">here</a>.</p>
<p>If you think there's a technical problem, please <a href="https://meta.miraheze.org/wiki/Help_center">contact the system administrators</a> and provide the following details:</p>
<p style="align:center;">
<table style="font-style: italic; font-size: 14px;" align="center">
<tbody>
<tr>
<td>Host: {$_SERVER['HTTP_HOST']}</td>
<td>Visitor IP: {$_SERVER['REMOTE_ADDR']}</td>
</tr>
<tr>
<td>Request URL: {$requestURL}</td>
<td>Timestamp: {$fullTimestamp}</td>
</tr>
</tbody>
</table>
</p>
</div>
<div style="float: right; padding-right: 1em;">
<a href="https://meta.miraheze.org/wiki/Miraheze">
<img src="https://static.miraheze.org/metawiki/7/7e/Powered_by_Miraheze.png" alt="Powered by Miraheze" />
</a>
</div>
</body>
</html>
EOF;
die( 1 );
} elseif ( !in_array( $wgDBname, $wgLocalDatabases ) && $wgCommandLineMode ) {
// $wgDBname will always be set to a string, even if the --wiki parameter was not passed to a script.
echo "The wiki database '$wgDBname' was not found." . PHP_EOL;
}