From: Tim Starling Date: Tue, 8 Feb 2011 12:08:21 +0000 (+0000) Subject: Merge r81718 from 1.17wmf1 X-Git-Tag: 1.31.0-rc.0~32120 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=62afaa0972e32599a4f4e81d8b4bc881520a94d7;p=lhc%2Fweb%2Fwiklou.git Merge r81718 from 1.17wmf1 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 66cf8776fd..71847cc0d3 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -301,12 +301,21 @@ function wfErrorLog( $text, $file ) { } else { throw new MWException( __METHOD__ . ': Invalid UDP specification' ); } + // Clean it up for the multiplexer if ( strval( $prefix ) !== '' ) { $text = preg_replace( '/^/m', $prefix . ' ', $text ); + + // Limit to 64KB + if ( strlen( $text ) > 65534 ) { + $text = substr( $text, 0, 65534 ); + } + if ( substr( $text, -1 ) != "\n" ) { $text .= "\n"; } + } elseif ( strlen( $text ) > 65535 ) { + $text = substr( $text, 0, 65535 ); } $sock = socket_create( $domain, SOCK_DGRAM, SOL_UDP );