From bf2587f024d4474a6eee31c021cf7beff475cdb6 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Wed, 29 Jun 2011 07:19:12 +0000 Subject: [PATCH] BacklinkCache was forgetting to check rd_interwiki when getting redirects, and thus getting some extranous backlinks for the redirect table (if there happened to be a page redirecting to an interwiki page with the same name plus an interwiki prefix). Not a major issue since this is really only used as far as i can tell, to purge squids and html file cache. A couple of extra unneeded purges shouldn't hurt anything, just a bit pointless. --- RELEASE-NOTES-1.19 | 2 ++ includes/BacklinkCache.php | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 6eaac8fa67..39ac011c55 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -130,6 +130,8 @@ production. * Use content language in formatting of dates in revertpage message (rollback revert edit summary) and do not adjust for user timezone. * (bug 29277) MediaWiki:Filepage.css is also shown on the local wiki +* Make sure Backlink cache does not retrieve interwiki redirects when looking for + redirects to a local page. === API changes in 1.19 === * BREAKING CHANGE: action=watch now requires POST and token. diff --git a/includes/BacklinkCache.php b/includes/BacklinkCache.php index e44e19dafb..37d830e232 100644 --- a/includes/BacklinkCache.php +++ b/includes/BacklinkCache.php @@ -207,10 +207,17 @@ class BacklinkCache { switch ( $table ) { case 'pagelinks': case 'templatelinks': + $conds = array( + "{$prefix}_namespace" => $this->title->getNamespace(), + "{$prefix}_title" => $this->title->getDBkey(), + "page_id={$prefix}_from" + ); + break; case 'redirect': $conds = array( "{$prefix}_namespace" => $this->title->getNamespace(), "{$prefix}_title" => $this->title->getDBkey(), + "{$prefix}_interwiki" => '', "page_id={$prefix}_from" ); break; -- 2.20.1