Documentation

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.

alwaysValid()

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
bool

defaultValidator()

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
Return values
bool
On this page

Search results