From 926851d0a9bc3f82c30dc7857805733cbbe5560a Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 10 Oct 2008 16:01:54 +0000 Subject: [PATCH] Tweak udp function to allow any prefix --- includes/RecentChange.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/RecentChange.php b/includes/RecentChange.php index d88bc4a5ae..a9e6bfea99 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -140,7 +140,7 @@ class RecentChange # Writes the data in this object to the database function save() { - global $wgLocalInterwiki, $wgPutIPinRC, $wgRC2UDPAddress, $wgRC2UDPOmitBots; + global $wgLocalInterwiki, $wgPutIPinRC, $wgRC2UDPAddress, $wgRC2UDPPrefix, $wgRC2UDPOmitBots; $fname = 'RecentChange::save'; $dbw = wfGetDB( DB_MASTER ); @@ -176,7 +176,7 @@ class RecentChange # Notify external application via UDP if ( $wgRC2UDPAddress && ( !$this->mAttribs['rc_bot'] || !$wgRC2UDPOmitBots ) ) { - self::sendToUDP( $this->getIRCLine() ); + self::sendToUDP( $wgRC2UDPPrefix, $this->getIRCLine() ); } # E-mail notifications @@ -209,13 +209,13 @@ class RecentChange * Send some text to UDP * @param string $line */ - static function sendToUDP( $line ) { + public static function sendToUDP( $prefix, $line ) { global $wgRC2UDPAddress, $wgRC2UDPPort, $wgRC2UDPPrefix; # Notify external application via UDP if( $wgRC2UDPAddress ) { $conn = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP ); if( $conn ) { - $line = $wgRC2UDPPrefix . $line; + $line = $prefix . $line; socket_sendto( $conn, $line, strlen($line), 0, $wgRC2UDPAddress, $wgRC2UDPPort ); socket_close( $conn ); } -- 2.20.1