From: Aaron Schulz Date: Mon, 19 Mar 2012 18:28:47 +0000 (+0000) Subject: Reverted r113688, r113691 per CR and filed #61440 upstream. X-Git-Tag: 1.31.0-rc.0~24198 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=7c54a3473059aedf2a8da3ad2a7bd54abf074703;p=lhc%2Fweb%2Fwiklou.git Reverted r113688, r113691 per CR and filed #61440 upstream. --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 0a48c23068..8b7aa00a5a 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2929,8 +2929,8 @@ function wfShellMaintenanceCmd( $script, array $parameters = array(), array $opt $cmd[] = $options['wrapper']; } $cmd[] = $script; - // Build up the full command, shell escaping each parameter - return implode( ' ', array_merge( $cmd, array_map( 'wfEscapeShellArg', $parameters ) ) ); + // Escape each parameter for shell + return implode( " ", array_map( 'wfEscapeShellArg', array_merge( $cmd, $parameters ) ) ); } /** diff --git a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php index 1938e67a6f..3cb42f126d 100644 --- a/tests/phpunit/includes/GlobalFunctions/GlobalTest.php +++ b/tests/phpunit/includes/GlobalFunctions/GlobalTest.php @@ -600,16 +600,16 @@ class GlobalTest extends MediaWikiTestCase { global $wgPhpCli; return array( array( 'eval.php', array( '--help', '--test' ), array(), - "$wgPhpCli eval.php '--help' '--test'", + "'$wgPhpCli' 'eval.php' '--help' '--test'", "Called eval.php --help --test" ), array( 'eval.php', array( '--help', '--test space' ), array('php' => 'php5'), - "php5 eval.php '--help' '--test space'", + "'php5' 'eval.php' '--help' '--test space'", "Called eval.php --help --test with php option" ), array( 'eval.php', array( '--help', '--test', 'X' ), array('wrapper' => 'MWScript.php'), - "$wgPhpCli MWScript.php eval.php '--help' '--test' 'X'", + "'$wgPhpCli' 'MWScript.php' 'eval.php' '--help' '--test' 'X'", "Called eval.php --help --test with wrapper option" ), array( 'eval.php', array( '--help', '--test', 'y' ), array('php' => 'php5', 'wrapper' => 'MWScript.php'), - "php5 MWScript.php eval.php '--help' '--test' 'y'", + "'php5' 'MWScript.php' 'eval.php' '--help' '--test' 'y'", "Called eval.php --help --test with wrapper and php option" ), ); }