97 $args = func_get_args();
98 if ( count(
$args ) === 1 && is_array( reset(
$args ) ) ) {
106 foreach (
$args as $arg ) {
107 if ( $arg ===
null ) {
126 $tokens = preg_split(
'/(\\\\*")/', $arg, -1, PREG_SPLIT_DELIM_CAPTURE );
129 foreach (
$tokens as $token ) {
130 if ( $iteration % 2 == 1 ) {
132 $arg .= str_replace(
'\\',
'\\\\', substr( $token, 0, -1 ) ) .
'\\"';
133 } elseif ( $iteration % 4 == 2 ) {
135 $arg .= str_replace(
'^',
'^^', $token );
145 if ( preg_match(
'/^(.*?)(\\\\+)$/', $arg, $m ) ) {
146 $arg = $m[1] . str_replace(
'\\',
'\\\\', $m[2] );
150 $retVal .=
'"' . $arg .
'"';
152 $retVal .= escapeshellarg( $arg );