r80769 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80768‎ | r80769 | r80770 >
Date:20:47, 22 January 2011
Author:roberthl
Status:deferred
Tags:
Comment:
Translate: Fix character escpaing in Python FFS writer.
Modified paths:
  • /trunk/extensions/Translate/FFS.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/FFS.php
@@ -1110,7 +1110,9 @@
11111111 $block = '';
11121112 foreach( $collection as $message ) {
11131113 if( $message->translation() == '' ) continue;
1114 - $translation = str_replace( '\'', '\\\'', $message->translation() );
 1114+ $translation = str_replace( '\\', '\\\\', $message->translation() );
 1115+ $translation = str_replace( '\'', '\\\'', $translation );
 1116+ $translation = str_replace( "\n", '\n', $translation );
11151117 $block .= "\t\t'{$message->key()}': u'{$translation}',\n";
11161118 }
11171119 return $block;

Status & tagging log