diff options
author | polo <ordipolo@gmx.fr> | 2022-03-01 04:02:05 +0100 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2022-03-01 04:02:05 +0100 |
commit | 2ac4254829fb27d878044978e4e89f15eeeddd23 (patch) | |
tree | d6ae70410566884d8bf567b0934cdaee5133a5a1 /controller/Security.php | |
parent | abd968a1c573b1862bd0728f0b7b6a88e307900a (diff) | |
download | melaine-2ac4254829fb27d878044978e4e89f15eeeddd23.zip |
factorisation et pages manquantes
Diffstat (limited to 'controller/Security.php')
-rw-r--r-- | controller/Security.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/controller/Security.php b/controller/Security.php index 6ea121c..c53cdc6 100644 --- a/controller/Security.php +++ b/controller/Security.php | |||
@@ -14,10 +14,16 @@ class Security | |||
14 | ); | 14 | ); |
15 | private static $specHtmLawed = ''; // optionnel: faire qu'un certain élément puisse n'avoir que certains attributs | 15 | private static $specHtmLawed = ''; // optionnel: faire qu'un certain élément puisse n'avoir que certains attributs |
16 | 16 | ||
17 | public static function secureString($chaine) | 17 | public static function secureString(string $chaine): string |
18 | { | 18 | { |
19 | $chaine = htmLawed($chaine, self::$configHtmLawed, self::$specHtmLawed); | 19 | $chaine = htmLawed($chaine, self::$configHtmLawed, self::$specHtmLawed); |
20 | $chaine = trim($chaine); // supprimer espaces, tabulations et sauts de ligne en début et fin de chaine (pour l'entrée de l'éditeur) | 20 | $chaine = trim($chaine); // supprimer espaces, tabulations et sauts de ligne en début et fin de chaine (pour l'entrée de l'éditeur) |
21 | return $chaine; | 21 | return $chaine; |
22 | } | 22 | } |
23 | } | 23 | } |
24 | |||
25 | function removeSpacesTabsCRLF(string $chaine): string | ||
26 | { | ||
27 | $cibles = [' ', "\t", "\n", "\r"]; // doubles quotes !! | ||
28 | return(str_replace($cibles, '', $chaine)); | ||
29 | } | ||