Use wfShellExec in parserTest.inc
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 26 Apr 2013 15:45:18 +0000 (17:45 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 27 Apr 2013 08:12:21 +0000 (08:12 +0000)
This avoids shell execution with backticks

Change-Id: Ib0db0c2ac36ae615f280ed9db82d2ca6aad744b5

tests/parser/parserTest.inc

index 7c8daf2..a0ede09 100644 (file)
@@ -1174,9 +1174,10 @@ class ParserTest {
 
                global $wgDiff3;
                // we assume that people with diff3 also have usual diff
-               $diff = ( wfIsWindows() && !$wgDiff3 )
-                       ? `fc $shellInfile $shellOutfile`
-                       : `diff -au $shellInfile $shellOutfile`;
+               $shellCommand = ( wfIsWindows() && !$wgDiff3 ) ? 'fc' : 'diff -au';
+
+               $diff = wfShellExec( "$shellCommand $shellInfile $shellOutfile" );
+
                unlink( $infile );
                unlink( $outfile );