From: Alexandre Emsenhuber Date: Fri, 8 Jan 2010 21:00:39 +0000 (+0000) Subject: * (bug 22051) Returing false in SpecialContributionsBeforeMainOutput hook now stops... X-Git-Tag: 1.31.0-rc.0~38350 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=da6c7bdeb84e2a90011dd8ebaf4c6435a976cdf7;p=lhc%2Fweb%2Fwiklou.git * (bug 22051) Returing false in SpecialContributionsBeforeMainOutput hook now stops normal output And while I was at it: * SpecialContributionsBeforeMainOutput was broken (throwing call_user_func_array() expects parameter 2 to be an array, NULL/integer given) since $id was not passed in array() * Removed some trailing whitespaces in RELEASE-NOTES --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a4f4e26ddb..349a4a10c0 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -288,9 +288,11 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 19791) Add URL of file source as comment to thumbs (for ImageMagick) * (bug 21946) Sorted wikitables do not properly handle minus signs * (bug 18885) Red links for media files do not support shared repositories -* Added $wgFixArchaicUnicode, which, if enabled, converts some deprecated - Unicode sequences in Arabic and Malayalam text to their Unicode 5.1 - equivalents. +* Added $wgFixArchaicUnicode, which, if enabled, converts some deprecated + Unicode sequences in Arabic and Malayalam text to their Unicode 5.1 + equivalents. +* (bug 22051) Returing false in SpecialContributionsBeforeMainOutput hook now + stops normal output === Bug fixes in 1.16 === diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index e5994f43e5..cc3fb01f8f 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -89,44 +89,45 @@ class SpecialContributions extends SpecialPage { return $this->feed( $feedType ); } - wfRunHooks( 'SpecialContributionsBeforeMainOutput', $id ); + if ( wfRunHooks( 'SpecialContributionsBeforeMainOutput', array( $id ) ) ) { - $wgOut->addHTML( $this->getForm() ); + $wgOut->addHTML( $this->getForm() ); - $pager = new ContribsPager( $target, $this->opts['namespace'], $this->opts['year'], $this->opts['month'] ); - if( !$pager->getNumRows() ) { - $wgOut->addWikiMsg( 'nocontribs', $target ); - } else { - # Show a message about slave lag, if applicable - if( ( $lag = $pager->getDatabase()->getLag() ) > 0 ) - $wgOut->showLagWarning( $lag ); - - $wgOut->addHTML( - '

' . $pager->getNavigationBar() . '

' . - $pager->getBody() . - '

' . $pager->getNavigationBar() . '

' - ); - } + $pager = new ContribsPager( $target, $this->opts['namespace'], $this->opts['year'], $this->opts['month'] ); + if( !$pager->getNumRows() ) { + $wgOut->addWikiMsg( 'nocontribs', $target ); + } else { + # Show a message about slave lag, if applicable + if( ( $lag = $pager->getDatabase()->getLag() ) > 0 ) + $wgOut->showLagWarning( $lag ); + + $wgOut->addHTML( + '

' . $pager->getNavigationBar() . '

' . + $pager->getBody() . + '

' . $pager->getNavigationBar() . '

' + ); + } - # Show the appropriate "footer" message - WHOIS tools, etc. - if( $target != 'newbies' ) { - $message = 'sp-contributions-footer'; - if ( IP::isIPAddress( $target ) ) { - $message = 'sp-contributions-footer-anon'; - } else { - $user = User::newFromName( $target ); - if ( !$user || $user->isAnon() ) { - // No message for non-existing users - return; + # Show the appropriate "footer" message - WHOIS tools, etc. + if( $target != 'newbies' ) { + $message = 'sp-contributions-footer'; + if ( IP::isIPAddress( $target ) ) { + $message = 'sp-contributions-footer-anon'; + } else { + $user = User::newFromName( $target ); + if ( !$user || $user->isAnon() ) { + // No message for non-existing users + return; + } } - } - $text = wfMsgNoTrans( $message, $target ); - if( !wfEmptyMsg( $message, $text ) && $text != '-' ) { - $wgOut->wrapWikiMsg( - "", - array( $message, $target ) ); + $text = wfMsgNoTrans( $message, $target ); + if( !wfEmptyMsg( $message, $text ) && $text != '-' ) { + $wgOut->wrapWikiMsg( + "", + array( $message, $target ) ); + } } } }