Remove duplicate param escaping code
authorYuri Astrakhan <yurik@wikimedia.org>
Thu, 9 Oct 2014 01:47:35 +0000 (21:47 -0400)
committerUmherirrender <umherirrender_de.wp@web.de>
Thu, 5 Mar 2015 17:06:04 +0000 (17:06 +0000)
commit7c75ee39766c9a521e369356b9e69c835a421703
tree42bf4826b09bbafe7b24da7d615a8c9d07e90f0c
parentab12824a45fc52a5ebd591c5bde6e9757bc65b5e
Remove duplicate param escaping code

wfEscapeShellArg() can handle multiple params, escaping each.
This patch changes wfShellExec() to call wfEscapeShellArg() directly
instead of doing the gluing itself.

This patch also extends wfEscapeShellArg() to accept an array parameter
optionally instead of as separate args, which is often useful.

Added also unit test cases for single, multiple args, and single array args.

Change-Id: I7a0761cc2ba98c210a9eacadd12da407d933e42a
includes/GlobalFunctions.php
tests/phpunit/includes/GlobalFunctions/wfEscapeShellArgTest.php [new file with mode: 0644]