SecurityInterface
in
Expected behavior of a Security.
Table of Contents
- getCookieName() : string
- Returns the CSRF Cookie Name.
- getHash() : string|null
- Returns the CSRF Hash.
- getHeaderName() : string
- Returns the CSRF Header Name.
- getTokenName() : string
- Returns the CSRF Token Name.
- isExpired() : bool
- Check if CSRF cookie is expired.
- sanitizeFilename() : string
- Sanitize Filename
- shouldRedirect() : bool
- Check if request should be redirect on failure.
- verify() : $this|false
- CSRF Verify
Methods
getCookieName()
Returns the CSRF Cookie Name.
public
getCookieName() : string
Return values
string —getHash()
Returns the CSRF Hash.
public
getHash() : string|null
Return values
string|null —getHeaderName()
Returns the CSRF Header Name.
public
getHeaderName() : string
Return values
string —getTokenName()
Returns the CSRF Token Name.
public
getTokenName() : string
Return values
string —isExpired()
Check if CSRF cookie is expired.
public
isExpired() : bool
Tags
Return values
bool —sanitizeFilename()
Sanitize Filename
public
sanitizeFilename(string $str[, bool $relativePath = false ]) : string
Tries to sanitize filenames in order to prevent directory traversal attempts and other security threats, which is particularly useful for files that were supplied via user input.
If it is acceptable for the user input to include relative paths, e.g. file/in/some/approved/folder.txt, you can set the second optional parameter, $relative_path to TRUE.
Parameters
- $str : string
-
Input file name
- $relativePath : bool = false
-
Whether to preserve paths
Return values
string —shouldRedirect()
Check if request should be redirect on failure.
public
shouldRedirect() : bool
Return values
bool —verify()
CSRF Verify
public
verify(RequestInterface $request) : $this|false
Parameters
- $request : RequestInterface