summaryrefslogtreecommitdiff
path: root/Core/Functions/func_sanitize.php
diff options
context:
space:
mode:
Diffstat (limited to 'Core/Functions/func_sanitize.php')
-rw-r--r--Core/Functions/func_sanitize.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/Core/Functions/func_sanitize.php b/Core/Functions/func_sanitize.php
new file mode 100644
index 0000000..afee91c
--- /dev/null
+++ b/Core/Functions/func_sanitize.php
@@ -0,0 +1,17 @@
+<?php
+
+// ############################################################################
+// # #
+// # Description: Fonction simple pour nettoyer un peu la data #
+// # #
+// ############################################################################
+
+function sanitize($data) {
+ // Retrait des espaces en début et fin de la variable.
+ $trimmed = trim($data);
+ // Retrait des charactères HTML (XSS).
+ $htmlChars = htmlspecialchars($trimmed);
+ return $htmlChars;
+}
+
+?> \ No newline at end of file