Allow gender based localisation for 'lastmodifiedatby'
[lhc/web/wiklou.git] / includes / RecentChange.php
index 885ff45..8e3f110 100644 (file)
@@ -197,6 +197,14 @@ class RecentChange
                                $this->mAttribs['rc_last_oldid'] );
                }
        }
+       
+       public function notifyRC2UDP() {
+               global $wgRC2UDPAddress, $wgRC2UDPOmitBots;
+               # Notify external application via UDP
+               if( $wgRC2UDPAddress && ( !$this->mAttribs['rc_bot'] || !$wgRC2UDPOmitBots ) ) {
+                       self::sendToUDP( $this->getIRCLine() );
+               }
+       }
 
        /**
         * Send some text to UDP
@@ -227,12 +235,12 @@ class RecentChange
        }
        
        /**
-        * Remove newlines and carriage returns
+        * Remove newlines, carriage returns and decode html entites
         * @param string $line
         * @return string
         */
        public static function cleanupForIRC( $text ) {
-               return str_replace(array("\n", "\r"), array("", ""), $text);
+               return Sanitizer::decodeCharReferences( str_replace( array( "\n", "\r" ), array( "", "" ), $text ) );
        }
 
        /**
@@ -471,7 +479,7 @@ class RecentChange
        {
                global $wgLogRestrictions;
                # Don't add private logs to RC!
-               if( isset($wgLogRestrictions[$type]) && !$wgLogRestrictions[$type] == '*' ) {
+               if( isset($wgLogRestrictions[$type]) && $wgLogRestrictions[$type] != '*' ) {
                        return false;
                }
                $rc = self::newLogEntry( $timestamp, $title, $user, $actionComment, $ip, $type, $action,
@@ -593,7 +601,7 @@ class RecentChange
                return $trail;
        }
 
-       protected function getIRCLine() {
+       public function getIRCLine() {
                global $wgUseRCPatrol, $wgUseNPPatrol, $wgRC2UDPInterwikiPrefix, $wgLocalInterwiki;
 
                // FIXME: Would be good to replace these 2 extract() calls with something more explicit