CommandPlaceholderArg
in package
FinalYes
Table of Contents
Properties
- $value : string
- A placeholders' value representing ONE command argument value (highly contextual).
Methods
- __construct() : mixed
- Constructor
- __toString() : string
- alwaysValid() : bool
- Basic function to enable bypassing of any validation of the provided value.
- defaultValidator() : bool
- Input validation helper function for determining if there are any blocked metacharacters which could be used to exploit OS command injections.
Properties
$value
A placeholders' value representing ONE command argument value (highly contextual).
private
string
$value
Methods
__construct()
Constructor
public
__construct(string $value, null|callable $validator) : mixed
Parameters
- $value : string
-
The actual placeholder value
- $validator : null|callable
-
Use null for the default one, otherwise any callable where the value to be tested is the first argument.
__toString()
public
__toString() : string
Return values
stringalwaysValid()
Basic function to enable bypassing of any validation of the provided value.
public
static alwaysValid(string $val) : bool
Only to be used when the value has been constructed without any unpredictable user input or has been thoroughly pre-sanitized
Parameters
- $val : string
Return values
booldefaultValidator()
Input validation helper function for determining if there are any blocked metacharacters which could be used to exploit OS command injections.
public
static defaultValidator(string $val) : bool
Parameters
- $val : string