class StringValidator (View source)

String validation for DNS records

Methods

validatePrintable(string $string)

Test if string is printable

validateNoHtmlTags(string $string)

Test if string has html opening and closing tags

validateProperQuoting(string $content)

Verify that the content is properly quoted

validateQuotesAround(string $string)

Verify that the string is enclosed in quotes

static bool
isValidDomain(string $domain)

Test if string is a valid domain name

validateDomain(string $domain)

Validate a domain name and return validation result

Details

static ValidationResult validatePrintable(string $string)

Test if string is printable

Parameters

string $string

string to validate

Return Value

ValidationResult

Validation result with error message if invalid

static ValidationResult validateNoHtmlTags(string $string)

Test if string has html opening and closing tags

Parameters

string $string

Input string

Return Value

ValidationResult

Validation result with error message if HTML tags found

static ValidationResult validateProperQuoting(string $content)

Verify that the content is properly quoted

Parameters

string $content

Return Value

ValidationResult

Validation result with error message if quotes not escaped

static ValidationResult validateQuotesAround(string $string)

Verify that the string is enclosed in quotes

Parameters

string $string

Input string

Return Value

ValidationResult

Validation result with error message if not enclosed in quotes

static bool isValidDomain(string $domain)

Test if string is a valid domain name

Parameters

string $domain

Domain name to validate

Return Value

bool

true if valid, false otherwise

static ValidationResult validateDomain(string $domain)

Validate a domain name and return validation result

Parameters

string $domain

Domain name to validate

Return Value

ValidationResult

ValidationResult with error message if invalid