(Bug 40652) Reject invalid titles as sitelinks
authorjeblad <john.blad@wikimedia.de>
Tue, 16 Oct 2012 10:24:47 +0000 (12:24 +0200)
committerjeblad <john.blad@wikimedia.de>
Tue, 16 Oct 2012 10:24:47 +0000 (12:24 +0200)
Titles are usually reported as "missing" if they
are not found, but if the title contains invalid
characters the title is reported as "invalid".
This changeset will make the page name normalization
also check if the "invalid" marker is set.

Change-Id: I86d432e8ea00c97891fb7849468caac6120252c6

includes/site/MediaWikiSite.php

index b05c421..71a17c8 100644 (file)
@@ -124,7 +124,12 @@ class MediaWikiSite extends SiteObject {
                $page = static::extractPageRecord( $data, $pageName );
 
                if ( isset( $page['missing'] ) ) {
-                       wfDebugLog( "MediaWikiSite", "call to <$url> returned a missing page title! " . $ret );
+                       wfDebugLog( "MediaWikiSite", "call to <$url> returned a marker for a missing page title! " . $ret );
+                       return false;
+               }
+
+               if ( isset( $page['invalid'] ) ) {
+                       wfDebugLog( "MediaWikiSite", "call to <$url> returned a marker for an invalid page title! " . $ret );
                        return false;
                }