Index: trunk/tools/web-scripts/missing.php |
— | — | @@ -85,7 +85,7 @@ |
86 | 86 | } |
87 | 87 | |
88 | 88 | $project = strtolower( $project ); |
89 | | -$projectcode = $projects[$project]; |
| 89 | +$projectcode = isset( $projects[$project] ) ? $projects[$project] : null; |
90 | 90 | $project = ucfirst( $project ); // for 404 pages message |
91 | 91 | |
92 | 92 | $location = $url['scheme'] . '://' . $base . 'W' . $projectcode . '/' . urlencode( $language ); |
— | — | @@ -94,6 +94,11 @@ |
95 | 95 | $location .= $page && $page !== '/' ? '/' . $page : |
96 | 96 | '?goto=mainpage' . ( isset( $_GET['uselang'] ) ? '&uselang=' . urlencode( $_GET['uselang'] ) : '' ); |
97 | 97 | |
| 98 | +# Not recognised (probably a wikimedia.org domain) -> redirect to a Meta page |
| 99 | +if( !$projectcode ) { |
| 100 | + $location = $url['scheme'] . '://meta.wikimedia.org/wiki/Missing_wiki'; |
| 101 | +} |
| 102 | + |
98 | 103 | $redir = false; |
99 | 104 | |
100 | 105 | switch( $projectcode ) { |