r52058 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52057‎ | r52058 | r52059 >
Date:17:24, 17 June 2009
Author:catrope
Status:deferred (Comments)
Tags:
Comment:
LocalisationUpdate: Replace eval() calls with ConfEditor::getVars(). Please test
Modified paths:
  • /trunk/extensions/LocalisationUpdate/LocalisationUpdate.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LocalisationUpdate/LocalisationUpdate.class.php
@@ -208,8 +208,8 @@
209209 }
210210
211211 // Get the array with messages
212 - // TODO: Security?
213 - eval( $basefilecontents );
 212+ $vars = new ConfEditor( $basefilecontents )->getVars();
 213+ $base_messages = $vars['base_messages'];
214214
215215 $comparefilecontents = self::getFileContents( $comparefile );
216216 if ( $comparefilecontents === false || $comparefilecontents === "" ) return array(); // Failed
@@ -229,8 +229,8 @@
230230 }
231231 }
232232 // Get the array
233 - // TODO: security?
234 - eval( $comparefilecontents );
 233+ $vars = new ConfEditor( $comparefilecontents )->getVars();
 234+ $compare_messages = $vars['compare_messages'];
235235
236236 // if the localfile and the remote file are the same, skip them!
237237 if ( $basehash == $comparehash && !$alwaysGetResult ) {
@@ -375,8 +375,8 @@
376376 }
377377
378378 // And get the real contents
379 - // TODO: security?
380 - eval( $basefilecontents );
 379+ $vars = new ConfEditor( $basefilecontents )->getVars();
 380+ $base_messages = $vars['base_messages'];
381381
382382 $comparefilecontents = self::getFileContents( $comparefile );
383383 if ( $comparefilecontents === false || $comparefilecontents === "" ) return 0; // Failed
@@ -395,8 +395,8 @@
396396 }
397397 }
398398 // Get the real array
399 - // TODO: security?
400 - eval( $comparefilecontents );
 399+ $vars = new ConfEditor( $comparefilecontents )->getVars();
 400+ $compare_messages = $vars['compare_messages'];
401401
402402 // If both files are the same, they can be skipped
403403 if ( $basehash == $comparehash && !$alwaysGetResult ) {

Comments

#Comment by Shinjiman (talk | contribs)   19:30, 17 June 2009

I've got this error:

PHP Parse error: parse error in mediawiki_svn\\extensions\\LocalisationUpdate\\LocalisationUpdate.class.php on line 211

#Comment by Catrope (talk | contribs)   21:47, 17 June 2009

Fixed by ialex in r52076

Status & tagging log