PHP Класс Phly\Http\HeaderSecurity

Code is largely lifted from the Zend\Http\Header\HeaderValue implementation in Zend Framework, released with the copyright and license below.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
assertValid ( string $value ) Assert a header value is valid.
assertValidName ( mixed $name ) Assert whether or not a header name is valid.
filter ( string $value ) : string Filter a header value
isValid ( string $value ) : boolean Validate a header value.

Приватные методы

Метод Описание
__construct ( ) Private constructor; non-instantiable.

Описание методов

assertValid() публичный статический Метод

Assert a header value is valid.
public static assertValid ( string $value )
$value string

assertValidName() публичный статический Метод

Assert whether or not a header name is valid.
См. также: http://tools.ietf.org/html/rfc7230#section-3.2
public static assertValidName ( mixed $name )
$name mixed

filter() публичный статический Метод

Ensures CRLF header injection vectors are filtered. Per RFC 7230, only VISIBLE ASCII characters, spaces, and horizontal tabs are allowed in values; header continuations MUST consist of a single CRLF sequence followed by a space or horizontal tab. This method filters any values not allowed from the string, and is lossy.
См. также: http://en.wikipedia.org/wiki/HTTP_response_splitting
public static filter ( string $value ) : string
$value string
Результат string

isValid() публичный статический Метод

Per RFC 7230, only VISIBLE ASCII characters, spaces, and horizontal tabs are allowed in values; header continuations MUST consist of a single CRLF sequence followed by a space or horizontal tab.
См. также: http://en.wikipedia.org/wiki/HTTP_response_splitting
public static isValid ( string $value ) : boolean
$value string
Результат boolean