Documentation

Core_Security
in package

Security helper. XSS protection. CSRF token.

Tags
subpackage

Core

version
7.x
author

Hostmake LLC

copyright

© 2005-2024 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru

Table of Contents

Properties

$_checkCsrfError  : null|string
The last CSRF error

Methods

checkCsrf()  : bool
Check valid CSRF-token
checkXSS()  : bool
Check XSS
getCsrfError()  : mixed
Get last CSRF error
getCsrfToken()  : mixed
Get CSRF token
throwCsrfError()  : mixed
Throw csrf error
_chr_hexdec()  : string
Callback for hexadecimals

Properties

$_checkCsrfError

The last CSRF error

protected static null|string $_checkCsrfError = \NULL

Methods

checkCsrf()

Check valid CSRF-token

public static checkCsrf(string $secret_csrf, mixed $lifetime) : bool
Parameters
$secret_csrf : string

Token to check

$lifetime : mixed
Return values
bool

checkXSS()

Check XSS

public static checkXSS(string $string) : bool
Parameters
$string : string
Return values
bool

getCsrfError()

Get last CSRF error

public static getCsrfError() : mixed

getCsrfToken()

Get CSRF token

public static getCsrfToken() : mixed

throwCsrfError()

Throw csrf error

public static throwCsrfError() : mixed

_chr_hexdec()

Callback for hexadecimals

protected static _chr_hexdec(array<string|int, mixed> $matches) : string
Parameters
$matches : array<string|int, mixed>
Return values
string

        
On this page

Search results