From 150136c9dd78c026bcd11f430237e8f17c0c201f Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Sun, 26 Aug 2007 23:08:46 +0000 Subject: [PATCH] * Adding a newline before the statistics footer, to prevent parsing problems * Preventing the TOC from appearing in Special:Statistics --- RELEASE-NOTES | 2 ++ includes/SpecialStatistics.php | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 97170c76c6..f571cb73ab 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -417,6 +417,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 10347) Add subtitle message to indicate that the page being viewed is protected. * Double encoding broke Special:Newpages for some languages +* Adding a newline before the statistics footer, to prevent parsing problems +* Preventing the TOC from appearing in Special:Statistics == API changes since 1.10 == diff --git a/includes/SpecialStatistics.php b/includes/SpecialStatistics.php index 9358c0bc4f..a29811da98 100644 --- a/includes/SpecialStatistics.php +++ b/includes/SpecialStatistics.php @@ -31,7 +31,8 @@ function wfSpecialStatistics( $par = '' ) { echo "total=$total;good=$good;views=$views;edits=$edits;users=$users;admins=$admins;images=$images;jobs=$numJobs\n"; return; } else { - $text = '==' . wfMsg( 'sitestats' ) . "==\n"; + $text = "__NOTOC__\n"; + $text .= '==' . wfMsg( 'sitestats' ) . "==\n"; $text .= wfMsgExt( 'sitestatstext', array( 'parsemag' ), $wgLang->formatNum( $total ), $wgLang->formatNum( $good ), @@ -41,16 +42,16 @@ function wfSpecialStatistics( $par = '' ) { $wgLang->formatNum( sprintf( '%.2f', $edits ? $views / $edits : 0 ) ), $wgLang->formatNum( $numJobs ), $wgLang->formatNum( $images ) - ); + )."\n"; - $text .= "\n==" . wfMsg( 'userstats' ) . "==\n"; + $text .= "==" . wfMsg( 'userstats' ) . "==\n"; $text .= wfMsgExt( 'userstatstext', array ( 'parsemag' ), $wgLang->formatNum( $users ), $wgLang->formatNum( $admins ), '[[' . wfMsgForContent( 'grouppage-sysop' ) . ']]', # TODO somehow remove, kept for backwards compatibility $wgLang->formatNum( sprintf( '%.2f', $admins / $users * 100 ) ), User::makeGroupLinkWiki( 'sysop' ) - ); + )."\n"; global $wgDisableCounters, $wgMiserMode, $wgUser, $wgLang, $wgContLang; if( !$wgDisableCounters && !$wgMiserMode ) { @@ -72,7 +73,7 @@ function wfSpecialStatistics( $par = '' ) { ) ); if( $res->numRows() > 0 ) { - $text .= "\n==" . wfMsg( 'statistics-mostpopular' ) . "==\n"; + $text .= "==" . wfMsg( 'statistics-mostpopular' ) . "==\n"; while( $row = $res->fetchObject() ) { $title = Title::makeTitleSafe( $row->page_namespace, $row->page_title ); if( $title instanceof Title ) @@ -84,7 +85,7 @@ function wfSpecialStatistics( $par = '' ) { $footer = wfMsg( 'statistics-footer' ); if( !wfEmptyMsg( 'statistics-footer', $footer ) && $footer != '' ) - $text .= $footer; + $text .= "\n" . $footer; $wgOut->addWikiText( $text ); } -- 2.20.1