value = $value; return; } debug('Invalid placeholder argument value: ' . $value); throw new Exception('Invalid placeholder argument value: ' . $value); } /** * Input validation helper function for determining if there are any blocked metacharacters which could be used to * exploit OS command injections. */ public static function defaultValidator(string $val): bool { // ; & | $ > < ` \ ! ' " ( ) including white space return !preg_match('/[;&|\$><`\\!\'"()\s]/', $val); } public function __toString(): string { return $this->value; } /** * Basic function to enable bypassing of any validation of the provided value. * Only to be used when the value has been constructed without any unpredictable user input or * has been thoroughly pre-sanitized */ public static function alwaysValid(string $val): bool { return true; } }