r114162 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114161‎ | r114162 | r114163 >
Date:18:28, 19 March 2012
Author:aaron
Status:ok
Tags:
Comment:
Reverted r113688, r113691 per CR and filed #61440 upstream.
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/GlobalFunctions/GlobalTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/GlobalFunctions/GlobalTest.php
@@ -600,16 +600,16 @@
601601 global $wgPhpCli;
602602 return array(
603603 array( 'eval.php', array( '--help', '--test' ), array(),
604 - "$wgPhpCli eval.php '--help' '--test'",
 604+ "'$wgPhpCli' 'eval.php' '--help' '--test'",
605605 "Called eval.php --help --test" ),
606606 array( 'eval.php', array( '--help', '--test space' ), array('php' => 'php5'),
607 - "php5 eval.php '--help' '--test space'",
 607+ "'php5' 'eval.php' '--help' '--test space'",
608608 "Called eval.php --help --test with php option" ),
609609 array( 'eval.php', array( '--help', '--test', 'X' ), array('wrapper' => 'MWScript.php'),
610 - "$wgPhpCli MWScript.php eval.php '--help' '--test' 'X'",
 610+ "'$wgPhpCli' 'MWScript.php' 'eval.php' '--help' '--test' 'X'",
611611 "Called eval.php --help --test with wrapper option" ),
612612 array( 'eval.php', array( '--help', '--test', 'y' ), array('php' => 'php5', 'wrapper' => 'MWScript.php'),
613 - "php5 MWScript.php eval.php '--help' '--test' 'y'",
 613+ "'php5' 'MWScript.php' 'eval.php' '--help' '--test' 'y'",
614614 "Called eval.php --help --test with wrapper and php option" ),
615615 );
616616 }
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -2929,8 +2929,8 @@
29302930 $cmd[] = $options['wrapper'];
29312931 }
29322932 $cmd[] = $script;
2933 - // Build up the full command, shell escaping each parameter
2934 - return implode( ' ', array_merge( $cmd, array_map( 'wfEscapeShellArg', $parameters ) ) );
 2933+ // Escape each parameter for shell
 2934+ return implode( " ", array_map( 'wfEscapeShellArg', array_merge( $cmd, $parameters ) ) );
29352935 }
29362936
29372937 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113688Made wfShellMaintenanceCmd() not totally broken due to excess shell escaping.aaron00:05, 13 March 2012
r113691r113688: updated test assertionsaaron00:18, 13 March 2012

Status & tagging log