public package
Foswiki::Sandbox sysCommand
function in this package.
Since date indicates where functions or parameters have been added since
the baseline of the API (TWiki release 4.2.3). The date indicates the
earliest date of a Foswiki release that will support that function or
parameter.
Deprecated date indicates where a function or parameters has been
deprecated. Deprecated
functions will still work, though they should
not be called in new plugins and should be replaced in older plugins
as soon as possible. Deprecated parameters are simply ignored in Foswiki
releases after date.
Until date indicates where a function or parameter has been removed.
The date indicates the latest date at which Foswiki releases still supported
the function or parameter.
StaticMethod
untaintUnchecked ( $string ) → $untainted $string
without any checks. If $string is
undefined, return undef.
This function doesn't perform any checks on the data being untainted.
Callers must ensure that $string
does not contain any dangerous content,
such as interpolation characters, if it is to be used in potentially
unsafe operations.
StaticMethod
untaint ( $datum, \&method, ... ) → $untainted StaticMethod
validateWebName($name) → $web StaticMethod
validateTopicName($name) → $topic StaticMethod
validateAttachmentName($name) → $attachment StaticMethod
normalizeFileName( $string ) → $filename $string
contains filtered characters, as
defined by $Foswiki::cfg{AttachmentNameFilter}
The returned string is not tainted, but it may contain shell
metacharacters and even control characters.
DEPRECATED - provided for compatibility only. Do not use!
If you want to validate an attachment, use
untaint($name, \&validateAttachmentName)
StaticMethod
sanitizeAttachmentName($fname) → ($fileName, $origName) StaticMethod
sysCommand( $class, $template, %params ) → ( $data, $exit, $stderr ) $template
and %params
, and returns the output of the program and an exit code.
STDOUT is returned. STDERR is returned if possible (or is undef if not).
$class is ignored, and is only present for compatibility.
The caller has to ensure that the invoked program does not react in a
harmful way to the passed arguments. sysCommand
merely
ensures that the shell does not interpret any of the passed arguments.
$template is a template command-line for the program, which contains
typed tokens that are replaced with parameter values passed in the
sysCommand
call. For example,
my ( $output, $exit ) = Foswiki::Sandbox->sysCommand( $command, FILENAME => $filename );where
$command
is a template for the command - for example,
/usr/bin/rcs -i -t-none -kb %FILENAME|F%
$template
is split at whitespace, and '' strings contained in it
are replaced with $params{VAR}
. %params
values may consist of scalars and
array references. Array references are dereferenced and the
array elements are inserted. '' can optionally take the form '%VAR|T%',
where FLAG is a single character type flag. Permitted type flags are U
untaint without further checks -- dangerous,
F
normalize as file name,
N
generalized number,
S
simple, short string,
D
RCS format date
![]() |
© 2025 D.Soost & D.Marxsen - All rights reserved © Of all articles by authors Trademarks are the property of their respective owners © Logo by Wikipedia, modified by Administrator | Impressum Disclaimer Datenschutzerklärung |