This repository was archived by the owner on Sep 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +29
-9
lines changed Expand file tree Collapse file tree 4 files changed +29
-9
lines changed Original file line number Diff line number Diff line change
1
+ RewriteEngine on
2
+ # Equivalent to ErrorDocument, but uses a relative path
3
+ RewriteCond %{REQUEST_FILENAME} !-f
4
+ RewriteCond %{REQUEST_FILENAME} !-d
5
+ RewriteRule .* 404.php [L]
Original file line number Diff line number Diff line change
1
+ <?php
2
+ header ( 'HTTP/1.0 404 Not Found ' );
3
+ require_once "includes.php " ;
4
+
5
+ echo new \OOUI \MessageWidget ( [
6
+ 'type ' => 'error ' ,
7
+ 'label ' => 'Page not found. The wiki you are looking for may have been deleted. '
8
+ ] );
9
+
10
+ include "footer.html " ;
Original file line number Diff line number Diff line change 16
16
17
17
OOUI \Theme::setSingleton ( new OOUI \WikimediaUITheme () );
18
18
19
+ $ basePath = dirname ( $ _SERVER ['SCRIPT_NAME ' ] );
20
+ if ( $ basePath === '/ ' ) {
21
+ $ basePath = '' ;
22
+ }
23
+ $ is404 = basename ( $ _SERVER ['SCRIPT_NAME ' ] ) === '404.php ' ;
24
+
19
25
echo '<!DOCTYPE html>
20
26
<html>
21
27
<head>
22
28
<meta charset="utf-8">
23
29
<title>Patch demo</title>
24
- <link rel="stylesheet" href="index.css">
25
- <link rel="stylesheet" href="node_modules/oojs-ui/dist/oojs-ui-wikimediaui.min.css">
26
- <link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">
27
- <link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">
28
- <link rel="mask-icon" href="images/safari-pinned-tab.svg" color="#006699">
29
- <link rel="shortcut icon" href="images/favicon.ico">
30
+ <link rel="stylesheet" href=" ' . $ basePath . ' / index.css">
31
+ <link rel="stylesheet" href=" ' . $ basePath . ' / node_modules/oojs-ui/dist/oojs-ui-wikimediaui.min.css">
32
+ <link rel="icon" type="image/png" sizes="32x32" href=" ' . $ basePath . ' / images/favicon-32x32.png">
33
+ <link rel="icon" type="image/png" sizes="16x16" href=" ' . $ basePath . ' / images/favicon-16x16.png">
34
+ <link rel="mask-icon" href=" ' . $ basePath . ' / images/safari-pinned-tab.svg" color="#006699">
35
+ <link rel="shortcut icon" href=" ' . $ basePath . ' / images/favicon.ico">
30
36
</head>
31
37
<body>
32
38
<header>
33
39
<div class="headerInner">
34
- <h1><a class="logo" href=".">Patch demo</a></h1> ' ;
40
+ <h1><a class="logo" href=" ' . $ basePath . ' / .">Patch demo</a></h1> ' ;
35
41
36
42
include_once 'oauth.php ' ;
37
43
Original file line number Diff line number Diff line change 9
9
10
10
$ useOAuth = !empty ( $ config [ 'oauth ' ][ 'url ' ] );
11
11
12
- if ( $ useOAuth ) {
12
+ if ( $ useOAuth && ! $ is404 ) {
13
13
$ conf = new ClientConfig ( $ config [ 'oauth ' ][ 'url ' ] );
14
14
$ conf ->setConsumer ( new Consumer (
15
15
$ config [ 'oauth ' ][ 'key ' ],
48
48
include 'footer.html ' ;
49
49
die ();
50
50
}
51
-
52
51
}
You can’t perform that action at this time.
0 commit comments