Index: trunk/phase3/includes/LogEventsList.php |
— | — | @@ -326,6 +326,7 @@ |
327 | 327 | * @return String: Formatted HTML list item |
328 | 328 | */ |
329 | 329 | public function logLine( $row ) { |
| 330 | + $row->user_name = $this->fixUserName($row->user_name, $row->log_user); |
330 | 331 | $entry = DatabaseLogEntry::newFromRow( $row ); |
331 | 332 | $formatter = LogFormatter::newFromEntry( $entry ); |
332 | 333 | $formatter->setShowUserToolLinks( !( $this->flags & self::NO_EXTRA_USER_LINKS ) ); |
— | — | @@ -706,6 +707,11 @@ |
707 | 708 | $s = str_replace( '$1', $s, $wrap ); |
708 | 709 | } |
709 | 710 | |
| 711 | + /* hook can return false, if we don't want the message to be emitted (Wikia BugId:7093) */ |
| 712 | + if (!wfRunHooks('LogEventsListShowLogExtract', array(&$s, $types, $page, $user, $param))) { |
| 713 | + return $pager->getNumRows(); |
| 714 | + } |
| 715 | + |
710 | 716 | // $out can be either an OutputPage object or a String-by-reference |
711 | 717 | if( $out instanceof OutputPage ){ |
712 | 718 | $out->addHTML( $s ); |
— | — | @@ -740,6 +746,23 @@ |
741 | 747 | } |
742 | 748 | return false; |
743 | 749 | } |
| 750 | + |
| 751 | + /** |
| 752 | + * if user_name is empty - use User class to get his name |
| 753 | + * @param $user_name string |
| 754 | + * @param $user_id integer |
| 755 | + * @return string |
| 756 | + */ |
| 757 | + public function fixUserName($user_name, $user_id) { |
| 758 | + if ( empty($user_name) ) { |
| 759 | + $oUser = User::newFromID($user_id); |
| 760 | + if ( $oUser instanceof User ) { |
| 761 | + $user_name = $oUser->getName(); |
| 762 | + } |
| 763 | + } |
| 764 | + |
| 765 | + return $user_name; |
| 766 | + } |
744 | 767 | } |
745 | 768 | |
746 | 769 | /** |
— | — | @@ -1004,6 +1027,10 @@ |
1005 | 1028 | if( $this->getNumRows() > 0 ) { |
1006 | 1029 | $lb = new LinkBatch; |
1007 | 1030 | foreach ( $this->mResult as $row ) { |
| 1031 | + $row->user_name = $this->mLogEventsList->fixUserName($row->user_name, $row->log_user); |
| 1032 | + if ( empty($row->user_name) ) { |
| 1033 | + continue; |
| 1034 | + } |
1008 | 1035 | $lb->add( $row->log_namespace, $row->log_title ); |
1009 | 1036 | $lb->addObj( Title::makeTitleSafe( NS_USER, $row->user_name ) ); |
1010 | 1037 | $lb->addObj( Title::makeTitleSafe( NS_USER_TALK, $row->user_name ) ); |