From 6c4c058ca13067cee0ffb9ca1940acba9af4b8fc Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 15 May 2007 06:41:49 +0000 Subject: [PATCH] Revert r22159 as per wikitech-l. --- includes/SpecialAllmessages.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/includes/SpecialAllmessages.php b/includes/SpecialAllmessages.php index e38952e843..0862cd1747 100644 --- a/includes/SpecialAllmessages.php +++ b/includes/SpecialAllmessages.php @@ -119,13 +119,16 @@ 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. - $talkPageExists = array(); + $pageExists = array( + NS_MEDIAWIKI => array(), + NS_MEDIAWIKI_TALK => array() + ); $dbr = wfGetDB( DB_SLAVE ); $page = $dbr->tableName( 'page' ); - $sql = "SELECT page_title FROM $page WHERE page_namespace IN (" . NS_MEDIAWIKI_TALK . ")"; + $sql = "SELECT page_namespace,page_title FROM $page WHERE page_namespace IN (" . NS_MEDIAWIKI . ", " . NS_MEDIAWIKI_TALK . ")"; $res = $dbr->query( $sql ); while( $s = $dbr->fetchObject( $res ) ) { - $talkPageExists[$s->page_title] = true; + $pageExists[$s->page_namespace][$s->page_title] = true; } $dbr->freeResult( $res ); wfProfileOut( __METHOD__ . "-check" ); @@ -147,9 +150,12 @@ function makeHTMLText( $messages ) { $message = htmlspecialchars( $m['statmsg'] ); $mw = htmlspecialchars( $m['msg'] ); - $pageLink = $sk->makeKnownLinkObj( $titleObj, "" . htmlspecialchars( $key ) . '' ); - - if( isset( $talkPageExists[$title] ) ) { + 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] ) ) { $talkLink = $sk->makeKnownLinkObj( $talkPage, htmlspecialchars( $talk ) ); } else { $talkLink = $sk->makeBrokenLinkObj( $talkPage, htmlspecialchars( $talk ) ); -- 2.20.1