From: Antoine Musso Date: Sat, 26 May 2007 16:50:14 +0000 (+0000) Subject: Fix for r22450: handle links to special pages when using Linker::makeLink(); X-Git-Tag: 1.31.0-rc.0~52801 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=71c9164843c89b85328fd2cff7c9671fb5b43421;p=lhc%2Fweb%2Fwiklou.git Fix for r22450: handle links to special pages when using Linker::makeLink(); --- diff --git a/includes/Linker.php b/includes/Linker.php index 1f3494b5bb..75fd64c976 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -218,6 +218,20 @@ class Linker { $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); } else { wfProfileIn( $fname.'-immediate' ); + + # Handles links to special pages wich do not exist in the database: + if( $nt->getNamespace() == NS_SPECIAL ) { + if( SpecialPage::exists( $nt->getDbKey() ) ) { + $retVal = $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); + } else { + $retVal = $this->makeBrokenLinkObj( $nt, $text, $query, $trail, $prefix ); + } + wfProfileOut( $fname.'-immediate' ); + wfProfileOut( $fname ); +print "returning $retVal;"; + return $retVal; + } + # Work out link colour immediately $aid = $nt->getArticleID() ; if ( 0 == $aid ) {