r98857 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98856‎ | r98857 | r98858 >
Date:14:32, 4 October 2011
Author:ialex
Status:ok
Tags:
Comment:
Simplify a bit by adding the result inside the wfRunHooks() check
Modified paths:
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogEventsList.php
@@ -707,16 +707,15 @@
708708 }
709709
710710 /* hook can return false, if we don't want the message to be emitted (Wikia BugId:7093) */
711 - if ( !wfRunHooks( 'LogEventsListShowLogExtract', array( &$s, $types, $page, $user, $param ) ) ) {
712 - return $pager->getNumRows();
 711+ if ( wfRunHooks( 'LogEventsListShowLogExtract', array( &$s, $types, $page, $user, $param ) ) ) {
 712+ // $out can be either an OutputPage object or a String-by-reference
 713+ if ( $out instanceof OutputPage ){
 714+ $out->addHTML( $s );
 715+ } else {
 716+ $out = $s;
 717+ }
713718 }
714719
715 - // $out can be either an OutputPage object or a String-by-reference
716 - if( $out instanceof OutputPage ){
717 - $out->addHTML( $s );
718 - } else {
719 - $out = $s;
720 - }
721720 return $pager->getNumRows();
722721 }
723722

Status & tagging log