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
This commit is contained in:
umherirrender 2012-09-08 06:57:10 +02:00
parent d6b9ab35a8
commit d7720f1960
2 changed files with 6 additions and 1 deletions

View file

@ -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;
}

View file

@ -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 ) {