https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114112

Revision: 114112
Author:   robin
Date:     2012-03-18 21:01:11 +0000 (Sun, 18 Mar 2012)
Log Message:
-----------
When it's an unrecognised project (wikimedia.org domain), redirect to a default 
Meta page instead of any useless Incubator page. See bug 33809. (I'll create 
the Meta page when this is marked ok.)

Modified Paths:
--------------
    trunk/tools/web-scripts/missing.php

Modified: trunk/tools/web-scripts/missing.php
===================================================================
--- trunk/tools/web-scripts/missing.php 2012-03-18 21:00:50 UTC (rev 114111)
+++ trunk/tools/web-scripts/missing.php 2012-03-18 21:01:11 UTC (rev 114112)
@@ -85,7 +85,7 @@
 }
 
 $project = strtolower( $project );
-$projectcode = $projects[$project];
+$projectcode = isset( $projects[$project] ) ? $projects[$project] : null;
 $project = ucfirst( $project ); // for 404 pages message
 
 $location = $url['scheme'] . '://' . $base . 'W' . $projectcode . '/' . 
urlencode( $language );
@@ -94,6 +94,11 @@
 $location .= $page && $page !== '/' ? '/' . $page :
        '?goto=mainpage' . ( isset( $_GET['uselang'] ) ? '&uselang=' . 
urlencode( $_GET['uselang'] ) : '' );
 
+# Not recognised (probably a wikimedia.org domain) -> redirect to a Meta page
+if( !$projectcode ) {
+       $location = $url['scheme'] . '://meta.wikimedia.org/wiki/Missing_wiki';
+}
+
 $redir = false;
 
 switch( $projectcode ) {


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to