FRED™
3.0
FRED™: Framework for Rapid and Easy Development
Injection.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Rsi\Fred\Security\Check
;
4
5
class
Injection
extends
\Rsi\Fred\Security\Check{
6
7
public
$chars
= [
'\''
,
'"'
,
'<'
,
'>'
];
8
9
protected
function
arrayKeys
($array){
10
$keys = null;
11
if
(is_array($array))
foreach
($array as $key => $value) $keys .= $key . $this->
arrayKeys
($value);
12
return
$keys;
13
}
14
15
public
function
check
($expected =
false
){
16
$query =
17
urldecode($this->
component
(
'router'
)->pathInfo . ($_SERVER[
'QUERY_STRING'
] ?? null)) .
18
$this->
arrayKeys
($_POST);
19
foreach
($this->chars as $char)
if
(strpos($query,$char) !==
false
)
return
false
;
20
return
true
;
21
}
22
23
}
Rsi\Fred\Security\Check
Definition:
Csrf.php:3
Rsi\Fred\Security\Check\Injection\$chars
$chars
Definition:
Injection.php:7
Rsi\Fred\Security\Check\Injection\arrayKeys
arrayKeys($array)
Definition:
Injection.php:9
Rsi\Fred\Security\Check\Injection
Definition:
Injection.php:5
Rsi\Fred\Security\Check\Injection\check
check($expected=false)
Definition:
Injection.php:15
Rsi\Fred\Component\component
component($name)
Get a component (local or default).
Definition:
Component.php:80
src
Rsi
Fred
Security
Check
Injection.php
Generated on Sun Aug 2 2020 19:43:57 for FRED™ by
1.8.13