From 71c9164843c89b85328fd2cff7c9671fb5b43421 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Sat, 26 May 2007 16:50:14 +0000 Subject: [PATCH] Fix for r22450: handle links to special pages when using Linker::makeLink(); --- includes/Linker.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 ) { -- 2.20.1