From: Ori Livneh Date: Thu, 29 Aug 2013 20:24:35 +0000 (-0700) Subject: Fill in defaults for omitted parameters to RecentChange::sendToUDP X-Git-Tag: 1.31.0-rc.0~18843^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=23254c1eca50ca1929852c9f8a5c97723b911f04;p=lhc%2Fweb%2Fwiklou.git Fill in defaults for omitted parameters to RecentChange::sendToUDP Not all callers of RecentChange::sendToUDP pass all the parameters -- which is to be expected, since the sendToUDP's signature specifies the empty string as default. It is not correct to leave the values empty, though, since they are used to construct the logging URL. When the parameters are unset, the correct behavior should be to fill in defaults from $wgRC2UDP*, as was the case prior to I270bde418. This patch reverts to the old, correct behavior. Change-Id: I4570473ae7382e602292e58a41e440325a65a275 --- diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 45a8fbcaee..9854a85a9b 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -297,12 +297,18 @@ class RecentChange { * @deprecated since 1.22 */ public static function sendToUDP( $line, $address = '', $prefix = '', $port = '' ) { - global $wgRC2UDPPrefix, $wgRC2UDPInterwikiPrefix; + global $wgRC2UDPAddress, $wgRC2UDPInterwikiPrefix, $wgRC2UDPPort, $wgRC2UDPPrefix; + wfDeprecated( __METHOD__, '1.22' ); + # Assume default for standard RC case + $address = $address ? $address : $wgRC2UDPAddress; + $prefix = $prefix ? $prefix : $wgRC2UDPPrefix; + $port = $port ? $port : $wgRC2UDPPort; + $engine = new UDPRCFeedEngine(); $feed = array( - 'uri' => "udp://$address:$port/$wgRC2UDPPrefix", + 'uri' => "udp://$address:$port/$prefix", 'formatter' => 'IRCColourfulRCFeedFormatter', 'add_interwiki_prefix' => $wgRC2UDPInterwikiPrefix, );