X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2Frcfeed%2FIRCColourfulRCFeedFormatter.php;h=531a3eb2039d9c2f7c079f181308910a549ea4d3;hb=04191cc9512e5ebe31cc8ca268e2ab431f02796b;hp=0efcebf9a38c4758ab2b454c98b4cfc2c97ecbce;hpb=9a3a412f86ba2568bdf85f9c5def51bdb422032d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/rcfeed/IRCColourfulRCFeedFormatter.php b/includes/rcfeed/IRCColourfulRCFeedFormatter.php index 0efcebf9a3..531a3eb203 100644 --- a/includes/rcfeed/IRCColourfulRCFeedFormatter.php +++ b/includes/rcfeed/IRCColourfulRCFeedFormatter.php @@ -28,11 +28,20 @@ class IRCColourfulRCFeedFormatter implements RCFeedFormatter { /** * @see RCFeedFormatter::getLine + * @param array $feed + * @param RecentChange $rc + * @param string|null $actionComment + * @return string|null */ public function getLine( array $feed, RecentChange $rc, $actionComment ) { global $wgUseRCPatrol, $wgUseNPPatrol, $wgLocalInterwikis, $wgCanonicalServer, $wgScript; $attribs = $rc->getAttributes(); + if ( $attribs['rc_type'] == RC_CATEGORIZE ) { + // Don't send RC_CATEGORIZE events to IRC feed (T127360) + return null; + } + if ( $attribs['rc_type'] == RC_LOG ) { // Don't use SpecialPage::getTitleFor, backwards compatibility with // IRC API which expects "Log". @@ -56,7 +65,7 @@ class IRCColourfulRCFeedFormatter implements RCFeedFormatter { $query .= '&rcid=' . $attribs['rc_id']; } // HACK: We need this hook for WMF's secure server setup - Hooks::run( 'IRCLineURL', array( &$url, &$query, $rc ) ); + Hooks::run( 'IRCLineURL', [ &$url, &$query, $rc ] ); $url .= $query; } @@ -84,7 +93,9 @@ class IRCColourfulRCFeedFormatter implements RCFeedFormatter { ) ); $flag = $attribs['rc_log_action']; } else { - $comment = self::cleanupForIRC( $attribs['rc_comment'] ); + $comment = self::cleanupForIRC( + CommentStore::newKey( 'rc_comment' )->getComment( $attribs )->text + ); $flag = ''; if ( !$attribs['rc_patrolled'] && ( $wgUseRCPatrol || $attribs['rc_type'] == RC_NEW && $wgUseNPPatrol ) @@ -124,8 +135,8 @@ class IRCColourfulRCFeedFormatter implements RCFeedFormatter { */ public static function cleanupForIRC( $text ) { return str_replace( - array( "\n", "\r" ), - array( " ", "" ), + [ "\n", "\r" ], + [ " ", "" ], Sanitizer::decodeCharReferences( $text ) ); }