Sanitization Class

Aurora\Helpers Namespace


Methods

print

Sanitize a string and print it

Parameters

  • string $expr — String to sanitize and print

Signature

public function print(string $expr)

filter

Sanitize an object

Parameters

  • object $object — Object to sanitize
  • array $whitelist — Array of properties to keep

Return Value

  • object The sanitized object

Signature

public function filter(object $object, array $whitelist): object

whitelist

Keep the value only if it is in the whitelist

Parameters

  • string $var — Value to check
  • array $whitelist — Array with allowed items
  • string $default — Text to return if the value is not in the array

Return Value

  • string The value or the specified default

Signature

public function whitelist(string $var, array $whitelist, string $default = ''): string

Go to top