* (bug 22051) Returing false in SpecialContributionsBeforeMainOutput hook now stops...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 8 Jan 2010 21:00:39 +0000 (21:00 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Fri, 8 Jan 2010 21:00:39 +0000 (21:00 +0000)
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

RELEASE-NOTES
includes/specials/SpecialContributions.php

index a4f4e26..349a4a1 100644 (file)
@@ -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 ===
 
index e5994f4..cc3fb01 100644 (file)
@@ -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(
-                               '<p>' . $pager->getNavigationBar() . '</p>' .
-                               $pager->getBody() .
-                               '<p>' . $pager->getNavigationBar() . '</p>'
-                       );
-               }
+                       $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(
+                                       '<p>' . $pager->getNavigationBar() . '</p>' .
+                                       $pager->getBody() .
+                                       '<p>' . $pager->getNavigationBar() . '</p>'
+                               );
+                       }
 
 
-               # 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(
-                                       "<div class='mw-contributions-footer'>\n$1\n</div>",
-                                       array( $message, $target ) );
+                               $text = wfMsgNoTrans( $message, $target );
+                               if( !wfEmptyMsg( $message, $text ) && $text != '-' ) {
+                                       $wgOut->wrapWikiMsg(
+                                               "<div class='mw-contributions-footer'>\n$1\n</div>",
+                                               array( $message, $target ) );
+                               }
                        }
                }
        }