If 'namespace' was not null, and 'showRedirectTargets' was true (the default),
pages from namespaces other than the chosen one could appear in the
suggestions when a cross-namespace redirect from chosen to other namespace
was encountered. Prevent this.
Change-Id: Id863d002d598dc2429919e88dd2dde9e9836bb3d
imageUrl: OO.getProp( suggestionPage, 'thumbnail', 'source' ),
description: OO.getProp( suggestionPage, 'terms', 'description' )
};
- titles.push( suggestionPage.title );
+
+ // Throw away pages from wrong namespaces. This can happen when 'showRedirectTargets' is true
+ // and we encounter a cross-namespace redirect.
+ if ( this.namespace === null || this.namespace === suggestionPage.ns ) {
+ titles.push( suggestionPage.title );
+ }
redirects = redirectsTo[suggestionPage.title] || [];
for ( i = 0, len = redirects.length; i < len; i++ ) {