SecurityInterface
in
Expected behavior of a Security.
Table of Contents
Methods
- 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.
- 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
stringgetHash()
Returns the CSRF Hash.
public
getHash() : string|null
Return values
string|nullgetHeaderName()
Returns the CSRF Header Name.
public
getHeaderName() : string
Return values
stringgetTokenName()
Returns the CSRF Token Name.
public
getTokenName() : string
Return values
stringsanitizeFilename()
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, $relativePath to TRUE.
Parameters
- $str : string
-
Input file name
- $relativePath : bool = false
-
Whether to preserve paths
Return values
stringshouldRedirect()
Check if request should be redirect on failure.
public
shouldRedirect() : bool
Return values
boolverify()
CSRF Verify
public
verify(RequestInterface $request) : $this|false
Parameters
- $request : RequestInterface