* (bug 21455) Fixed "Watch this page" checkbox appearing on some special pages
even to non-logged in users
* (bug 21551) Make Squid reponse limit configurable
+* Fixed corruption of long UDP debug log messages by using socket_sendto()
+ instead of fsockopen() with fwrite().
== API changes in 1.16 ==
// IPv6 bracketed host
$protocol = $m[1];
$host = $m[2];
- $port = $m[3];
+ $port = intval( $m[3] );
$prefix = isset( $m[4] ) ? $m[4] : false;
+ $domain = AF_INET6;
} elseif ( preg_match( '!^(tcp|udp):(?://)?([a-zA-Z0-9.-]+):(\d+)(?:/(.*))?$!', $file, $m ) ) {
$protocol = $m[1];
$host = $m[2];
- $port = $m[3];
+ if ( !IP::isIPv4( $host ) ) {
+ $host = gethostbyname( $host );
+ }
+ $port = intval( $m[3] );
$prefix = isset( $m[4] ) ? $m[4] : false;
+ $domain = AF_INET;
} else {
throw new MWException( __METHOD__.": Invalid UDP specification" );
}
}
}
- $sock = fsockopen( "$protocol://$host", $port );
+ $sock = socket_create( $domain, SOCK_DGRAM, SOL_UDP );
if ( !$sock ) {
return;
}
- fwrite( $sock, $text );
- fclose( $sock );
+ socket_sendto( $sock, $text, strlen( $text ), 0, $host, $port );
+ socket_close( $sock );
} else {
wfSuppressWarnings();
$exists = file_exists( $file );