}
# Windows-compatible version of escapeshellarg()
+# Windows doesn't recognise single-quotes in the shell, but the escapeshellarg()
+# function puts single quotes in regardless of OS
function wfEscapeShellArg( )
{
$args = func_get_args();
} else {
$first = false;
}
-
- if ( function_exists( 'escapeshellarg' ) ) {
- $retVal .= escapeshellarg( $arg );
- } else {
+
+ if ( wfIsWindows() ) {
$retVal .= '"' . str_replace( '"','\"', $arg ) . '"';
+ } else {
+ $retVal .= escapeshellarg( $arg );
}
}
return $retVal;
}
}
+function wfIsWindows() {
+ if (substr(php_uname(), 0, 7) == 'Windows') {
+ return true;
+ } else {
+ return false;
+ }
+}
+
?>