From 79a7b5455eefdd5be08eb14ed9e0bd9b75ececb4 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 4 Jun 2009 07:26:46 +0000 Subject: [PATCH] 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. --- includes/MessageCache.php | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; } -- 2.20.1