r56776 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56775‎ | r56776 | r56777 >
Date:17:32, 22 September 2009
Author:avar
Status:deferred
Tags:
Comment:
Also mark ARRAY values as UTF-8
Modified paths:
  • /trunk/extensions/Translate/utils/TranslateYaml.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/utils/TranslateYaml.php
@@ -79,13 +79,15 @@
8080 'sub deutf8 {' .
8181 'if(ref($_[0]) eq "HASH") {' .
8282 'return { map { deutf8($_) } %{$_[0]} };' .
83 - '} else {' .
84 - 'my $s = $_[0];' .
85 - 'utf8::decode($s);' .
86 - 'return $s;' .
87 - '}' .
88 - '}' .
89 - "' 2>&1";
 83+ '} elsif(ref($_[0]) eq "ARRAY") {' .
 84+ 'return [ map { deutf8($_) } @{$_[0]} ];' .
 85+ '} else {' .
 86+ 'my $s = $_[0];' .
 87+ 'utf8::decode($s);' .
 88+ 'return $s;' .
 89+ '}' .
 90+ '}' .
 91+ "' 2>&1";
9092 $out = wfShellExec( $cmd, &$ret );
9193 if ( $ret != 0 ) {
9294 wfDebugDieBacktrace("The command '$cmd' died in execution with exit code '$ret': $out");

Status & tagging log