r51453 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51452‎ | r51453 | r51454 >
Date:07:26, 4 June 2009
Author:tstarling
Status:deferred
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/MessageCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/MessageCache.php
@@ -575,6 +575,16 @@
576576 if( $message === false ) {
577577 return '<' . htmlspecialchars($key) . '>';
578578 }
 579+
 580+ # Fix whitespace
 581+ $message = strtr( $message,
 582+ array(
 583+ # Fix for trailing whitespace, removed by textarea
 584+ ' ' => ' ',
 585+ # Fix for NBSP, converted to space by firefox
 586+ ' ' => "\xc2\xa0",
 587+ ) );
 588+
579589 return $message;
580590 }
581591

Follow-up revisions

RevisionCommit summaryAuthorDate
r51456Revert part of r50883, superseded by Tim's r51453nikerabbit07:38, 4 June 2009

Status & tagging log