blob: afee91cecddaa423867b92ec3311a9d8e0551c7b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;
}
?>
|