Merge "MovePage: Don't try to pass non-strings into Title::newFromText"
[lhc/web/wiklou.git] / includes / changes / EnhancedChangesList.php
index fe7deb6..e5916bd 100644 (file)
@@ -378,8 +378,12 @@ class EnhancedChangesList extends ChangesList {
                        $data['tags'] = $this->getTags( $rcObj, $classes );
 
                        // give the hook a chance to modify the data
-                       Hooks::run( 'EnhancedChangesListModifyLineData',
+                       $success = Hooks::run( 'EnhancedChangesListModifyLineData',
                                array( $this, &$data, $block, $rcObj ) );
+                       if ( !$success ) {
+                               // skip entry if hook aborted it
+                               continue;
+                       }
 
                        $line = '<tr' . $trClass . '><td></td><td class="mw-enhanced-rc">';
                        if ( isset( $data['recentChangesFlags'] ) ) {
@@ -540,12 +544,12 @@ class EnhancedChangesList extends ChangesList {
                        ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched';
 
                # Flag and Timestamp
-               $data['recentChangesFlags'] = $this->recentChangesFlags( array(
+               $data['recentChangesFlags'] = array(
                        'newpage' => $type == RC_NEW,
                        'minor' => $rcObj->mAttribs['rc_minor'],
                        'unpatrolled' => $rcObj->unpatrolled,
                        'bot' => $rcObj->mAttribs['rc_bot'],
-               ) );
+               );
                // timestamp is not really a link here, but is called timestampLink
                // for consistency with EnhancedChangesListModifyLineData
                $data['timestampLink'] = $rcObj->timestamp;
@@ -599,8 +603,12 @@ class EnhancedChangesList extends ChangesList {
                $data['watchingUsers'] = $this->numberofWatchingusers( $rcObj->numberofWatchingusers );
 
                // give the hook a chance to modify the data
-               Hooks::run( 'EnhancedChangesListModifyBlockLineData',
+               $success = Hooks::run( 'EnhancedChangesListModifyBlockLineData',
                        array( $this, &$data, $rcObj ) );
+               if ( !$success ) {
+                       // skip entry if hook aborted it
+                       return '';
+               }
 
                $line = Html::openElement( 'table', array( 'class' => $classes ) ) .
                        Html::openElement( 'tr' );