* (bug 5850) Added hexadecimal html entities comments for $digitTransformTable
entries.
* (bug 7432) Change language name for Aromanian (roa-rup)
+* (bug 908) Unexistent special pages now generate a red link.
== MediaWiki API changes since 1.10 ==
$this->mOutput->addImage( $nt->getDBkey() );
continue;
} elseif( $ns == NS_SPECIAL ) {
- $s .= $this->makeKnownLinkHolder( $nt, $text, '', $trail, $prefix );
+ if( SpecialPage::exists( $nt->getDBkey() ) ) {
+ $s .= $this->makeKnownLinkHolder( $nt, $text, '', $trail, $prefix );
+ } else {
+ $s .= $this->makeLinkHolder( $nt, $text, '', $trail, $prefix );
+ }
continue;
} elseif( $ns == NS_IMAGE ) {
$img = new Image( $nt );
$this->mOutput->addLink( $title, $id );
} elseif ( $linkCache->isBadLink( $pdbk ) ) {
$colours[$pdbk] = 0;
+ } elseif ( $title->getNamespace() == NS_SPECIAL && !SpecialPage::exists( $pdbk ) ) {
+ $colours[$pdbk] = 0;
} else {
# Not in the link cache, add it to the query
if ( !isset( $current ) ) {
unset( self::$mList[$name] );
}
+ /**
+ * Check if a given name exist as a special page or as a special page alias
+ * @param $name string: name of a special page
+ * @return boolean: true if a special page exists with this name
+ */
+ static function exists( $name ) {
+ if ( !self::$mListInitialised ) {
+ self::initList();
+ }
+ if( !self::$mAliases ) {
+ self::initAliasList();
+ }
+
+ # Remove special pages inline parameters:
+ $bits = explode( '/', $name );
+ $name = $bits[0];
+
+ return
+ array_key_exists( $name, self::$mList )
+ or array_key_exists( $name, self::$mAliases )
+ ;
+ }
+
/**
* Find the object with a given name and return it (or NULL)
* @static
* Should a link should be displayed as a known link, just based on its title?
*
* Currently, a self-link with a fragment and special pages are in
- * this category. Special pages never exist in the database. System
- * messages that have defined default values are also always known.
+ * this category. System messages that have defined default values are also
+ * always known.
*/
public function isAlwaysKnown() {
return ( $this->isExternal() ||
( 0 == $this->mNamespace && "" == $this->mDbkeyform ) ||
- ( NS_SPECIAL == $this->mNamespace ) ||
( NS_MEDIAWIKI == $this->mNamespace && wfMsgWeirdKey( $this->mDbkeyform ) ) );
}