Implement the escape_shell_arg and escape_shell_cmd functions

fixes #10004
This commit is contained in:
Gunnar Beutner 2015-08-27 08:57:56 +02:00
parent 73d8ffb462
commit 373b88df33
2 changed files with 4 additions and 0 deletions

View File

@ -21,6 +21,8 @@ get_time() | Returns the current UNIX timestamp.
parse_performance_data(pd) | Parses a performance data string and returns an array describing the values.
dirname(path) | Returns the directory portion of the specified path.
basename(path) | Returns the filename portion of the specified path.
escape\_shell\_arg(text) | Escapes a string for use as a single shell argument.
escape\_shell\_cmd(text) | Escapes shell meta characters in a string.
exit(integer) | Terminates the application.
## <a id="object-accessor-functions"></a> Object Accessor Functions

View File

@ -59,6 +59,8 @@ REGISTER_SAFE_SCRIPTFUNCTION(basename, &Utility::BaseName);
REGISTER_SAFE_SCRIPTFUNCTION(dirname, &Utility::DirName);
REGISTER_SAFE_SCRIPTFUNCTION(msi_get_component_path, &ScriptUtils::MsiGetComponentPathShim);
REGISTER_SAFE_SCRIPTFUNCTION(track_parents, &ScriptUtils::TrackParents);
REGISTER_SAFE_SCRIPTFUNCTION(escape_shell_cmd, &Utility::EscapeShellCmd);
REGISTER_SAFE_SCRIPTFUNCTION(escape_shell_arg, &Utility::EscapeShellArg);
String ScriptUtils::CastString(const Value& value)
{