From: Max Semenik Date: Thu, 22 Nov 2012 00:29:49 +0000 (+0400) Subject: Fix exception when searching for stuff beginning with "Media:" X-Git-Tag: 1.31.0-rc.0~21538^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=791d96bff3e9a468a8f564e500426561fdce4695;p=lhc%2Fweb%2Fwiklou.git Fix exception when searching for stuff beginning with "Media:" Change-Id: I8b5a419fa369ad91034c3769a4b228290b878e1b --- diff --git a/includes/search/SearchEngine.php b/includes/search/SearchEngine.php index ec542a612d..fa7b8729ae 100644 --- a/includes/search/SearchEngine.php +++ b/includes/search/SearchEngine.php @@ -187,6 +187,11 @@ class SearchEngine { return null; } + # Try files if searching in the Media: namespace + if ( $title->getNamespace() == NS_MEDIA ) { + $title = Title::makeTitle( NS_FILE, $title->getText() ); + } + if ( $title->isSpecialPage() || $title->isExternal() || $title->exists() ) { return $title; }