You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
893 B
33 lines
893 B
<?php
|
|
|
|
class Validation {
|
|
|
|
static function val_form_texte(string &$texte, array &$TMessage) {
|
|
if (!isset($texte)||$texte=="") {
|
|
$TMessage[] ="champs vide";
|
|
$texte="";
|
|
}
|
|
|
|
if ($texte != filter_var($texte, FILTER_SANITIZE_STRING))
|
|
{
|
|
$TMessage[] ="testative d'injection de code (attaque sécurité)";
|
|
$texte="";
|
|
}
|
|
|
|
}
|
|
|
|
static function val_form_mdp(string &$mdp, array &$TMessage) {
|
|
if (!isset($mdp)||$mdp=="") {
|
|
$TMessage[] ="pas de mdp";
|
|
$mdp="";
|
|
}
|
|
|
|
if ($mdp != filter_var($mdp, FILTER_SANITIZE_SPECIAL_CHARS))
|
|
{
|
|
$TMessage[] ="Le mot de passe ne doit pas contenir de caractères spéciaux";
|
|
$mdp="";
|
|
}
|
|
|
|
}
|
|
}
|
|
?>
|