From: umherirrender Date: Sat, 8 Sep 2012 04:57:10 +0000 (+0200) Subject: Fix Title::getRedirectsHere to respect interwiki prefix X-Git-Tag: 1.31.0-rc.0~22425^2 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=d7720f1960e2e9d53be6aac1fd59cd68426eb27f;p=lhc%2Fweb%2Fwiklou.git Fix Title::getRedirectsHere to respect interwiki prefix Respecting rd_interwiki is needed to act the same way than Special:Whatlinkshere. For local redirects it is needed to also check for NULL, not only the empty string Change-Id: I4f3f242d69054dcbb3c7a02441991196ba140986 --- diff --git a/includes/Title.php b/includes/Title.php index f9c7bdfa89..cd9eb94633 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -4433,6 +4433,11 @@ class Title { 'rd_title' => $this->getDBkey(), 'rd_from = page_id' ); + if ( $this->isExternal() ) { + $where['rd_interwiki'] = $this->getInterwiki(); + } else { + $where[] = 'rd_interwiki = ' . $dbr->addQuotes( '' ) . ' OR rd_interwiki IS NULL'; + } if ( !is_null( $ns ) ) { $where['page_namespace'] = $ns; } diff --git a/includes/specials/SpecialWhatlinkshere.php b/includes/specials/SpecialWhatlinkshere.php index 5d6a112685..f13564936a 100644 --- a/includes/specials/SpecialWhatlinkshere.php +++ b/includes/specials/SpecialWhatlinkshere.php @@ -163,7 +163,7 @@ class SpecialWhatLinksHere extends SpecialPage { 'rd_from = page_id', 'rd_namespace' => $target->getNamespace(), 'rd_title' => $target->getDBkey(), - '(rd_interwiki is NULL) or (rd_interwiki = \'\')' + 'rd_interwiki = ' . $dbr->addQuotes( '' ) . ' OR rd_interwiki IS NULL' ))); if( $fetchlinks ) {