X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Frcfeed%2FIRCColourfulRCFeedFormatter.php;h=ddea69511ac8c4bfe94849e154d9cdff329194ae;hb=2d250f636ae3bd88f9f221fea4a95f41cdfa60da;hp=30be3431650a623358599f76ce2513cd30e368c7;hpb=0d8e9eacae1f47c60518f871dbb73f4539413d39;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/rcfeed/IRCColourfulRCFeedFormatter.php b/includes/rcfeed/IRCColourfulRCFeedFormatter.php index 30be343165..ddea69511a 100644 --- a/includes/rcfeed/IRCColourfulRCFeedFormatter.php +++ b/includes/rcfeed/IRCColourfulRCFeedFormatter.php @@ -33,6 +33,11 @@ class IRCColourfulRCFeedFormatter implements RCFeedFormatter { 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 +61,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; } @@ -123,10 +128,10 @@ class IRCColourfulRCFeedFormatter implements RCFeedFormatter { * @return string */ public static function cleanupForIRC( $text ) { - return Sanitizer::decodeCharReferences( str_replace( - array( "\n", "\r" ), - array( " ", "" ), - $text - ) ); + return str_replace( + [ "\n", "\r" ], + [ " ", "" ], + Sanitizer::decodeCharReferences( $text ) + ); } }