From 62afaa0972e32599a4f4e81d8b4bc881520a94d7 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 8 Feb 2011 12:08:21 +0000 Subject: [PATCH] Merge r81718 from 1.17wmf1 --- includes/GlobalFunctions.php | 9 +++++++++ 1 file changed, 9 insertions(+) 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 ); -- 2.20.1