From: Ilmari Karonen Date: Mon, 14 May 2007 06:07:06 +0000 (+0000) Subject: All the MediaWiki: pages linked to from Special:Allmessages have at least a default... X-Git-Tag: 1.31.0-rc.0~52926 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=f5c1c0db70ddd5d06f7dde3792c722e0e721ab75;p=lhc%2Fweb%2Fwiklou.git All the MediaWiki: pages linked to from Special:Allmessages have at least a default value, there's no point in showing any of them as redlinks. --- diff --git a/includes/SpecialAllmessages.php b/includes/SpecialAllmessages.php index 0862cd1747..e38952e843 100644 --- a/includes/SpecialAllmessages.php +++ b/includes/SpecialAllmessages.php @@ -119,16 +119,13 @@ function makeHTMLText( $messages ) { # This is a nasty hack to avoid doing independent existence checks # without sending the links and table through the slow wiki parser. - $pageExists = array( - NS_MEDIAWIKI => array(), - NS_MEDIAWIKI_TALK => array() - ); + $talkPageExists = array(); $dbr = wfGetDB( DB_SLAVE ); $page = $dbr->tableName( 'page' ); - $sql = "SELECT page_namespace,page_title FROM $page WHERE page_namespace IN (" . NS_MEDIAWIKI . ", " . NS_MEDIAWIKI_TALK . ")"; + $sql = "SELECT page_title FROM $page WHERE page_namespace IN (" . NS_MEDIAWIKI_TALK . ")"; $res = $dbr->query( $sql ); while( $s = $dbr->fetchObject( $res ) ) { - $pageExists[$s->page_namespace][$s->page_title] = true; + $talkPageExists[$s->page_title] = true; } $dbr->freeResult( $res ); wfProfileOut( __METHOD__ . "-check" ); @@ -150,12 +147,9 @@ function makeHTMLText( $messages ) { $message = htmlspecialchars( $m['statmsg'] ); $mw = htmlspecialchars( $m['msg'] ); - if( isset( $pageExists[NS_MEDIAWIKI][$title] ) ) { - $pageLink = $sk->makeKnownLinkObj( $titleObj, "" . htmlspecialchars( $key ) . '' ); - } else { - $pageLink = $sk->makeBrokenLinkObj( $titleObj, "" . htmlspecialchars( $key ) . '' ); - } - if( isset( $pageExists[NS_MEDIAWIKI_TALK][$title] ) ) { + $pageLink = $sk->makeKnownLinkObj( $titleObj, "" . htmlspecialchars( $key ) . '' ); + + if( isset( $talkPageExists[$title] ) ) { $talkLink = $sk->makeKnownLinkObj( $talkPage, htmlspecialchars( $talk ) ); } else { $talkLink = $sk->makeBrokenLinkObj( $talkPage, htmlspecialchars( $talk ) );