From: Tim Starling Date: Thu, 4 Jun 2009 07:26:46 +0000 (+0000) Subject: General fix for trailing whitespace in messages, so that we don't have to put bugfix... X-Git-Tag: 1.31.0-rc.0~41510 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=79a7b5455eefdd5be08eb14ed9e0bd9b75ececb4;p=lhc%2Fweb%2Fwiklou.git General fix for trailing whitespace in messages, so that we don't have to put bugfix hacks at hundreds of places in the code to preserve HTML entities in messages that are formally plain text. Based on discussion with Nikerabbit. --- diff --git a/includes/MessageCache.php b/includes/MessageCache.php index 7f5d95da66..b831f33093 100644 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -575,6 +575,16 @@ class MessageCache { if( $message === false ) { return '<' . htmlspecialchars($key) . '>'; } + + # Fix whitespace + $message = strtr( $message, + array( + # Fix for trailing whitespace, removed by textarea + ' ' => ' ', + # Fix for NBSP, converted to space by firefox + ' ' => "\xc2\xa0", + ) ); + return $message; }