diff options
Diffstat (limited to 'src/controller/Security.php')
-rw-r--r-- | src/controller/Security.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/controller/Security.php b/src/controller/Security.php index f9092e2..7d592e9 100644 --- a/src/controller/Security.php +++ b/src/controller/Security.php | |||
@@ -3,6 +3,8 @@ | |||
3 | // | 3 | // |
4 | // htmlawed nettoie les entrées de l'utilisateur, en particulier le html de l'éditeur | 4 | // htmlawed nettoie les entrées de l'utilisateur, en particulier le html de l'éditeur |
5 | 5 | ||
6 | declare(strict_types=1); | ||
7 | |||
6 | class Security | 8 | class Security |
7 | { | 9 | { |
8 | private static $configHtmLawed = array( | 10 | private static $configHtmLawed = array( |
@@ -14,10 +16,10 @@ class Security | |||
14 | // liste noire d'attributs HTML | 16 | // liste noire d'attributs HTML |
15 | 'deny_attribute'=> 'id, class' // on garde 'style' | 17 | 'deny_attribute'=> 'id, class' // on garde 'style' |
16 | ); | 18 | ); |
17 | |||
18 | // faire qu'un certain élément puisse n'avoir que certains attributs, regarder la doc | 19 | // faire qu'un certain élément puisse n'avoir que certains attributs, regarder la doc |
19 | private static $specHtmLawed = ''; | 20 | private static $specHtmLawed = ''; |
20 | 21 | ||
22 | // ATTENTION, n'applique pas htmlspecialchars() !! | ||
21 | public static function secureString(string $chaine): string | 23 | public static function secureString(string $chaine): string |
22 | { | 24 | { |
23 | return trim(htmLawed($chaine, self::$configHtmLawed, self::$specHtmLawed));; | 25 | return trim(htmLawed($chaine, self::$configHtmLawed, self::$specHtmLawed));; |