From b092fd0d50e23b336f3103527b73fc1f6a9e78d1 Mon Sep 17 00:00:00 2001 From: jeblad Date: Tue, 16 Oct 2012 12:24:47 +0200 Subject: [PATCH] (Bug 40652) Reject invalid titles as sitelinks 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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/site/MediaWikiSite.php b/includes/site/MediaWikiSite.php index b05c421bd8..71a17c821e 100644 --- a/includes/site/MediaWikiSite.php +++ b/includes/site/MediaWikiSite.php @@ -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; } -- 2.20.1