|
|
|
@ -2,29 +2,29 @@
|
|
|
|
|
|
|
|
|
|
class Validation {
|
|
|
|
|
|
|
|
|
|
static function val_form_texte(string &$texte, array &$TMessage) {
|
|
|
|
|
static function val_form_texte(&$texte, &$TMessage) {
|
|
|
|
|
if (!isset($texte)||$texte=="") {
|
|
|
|
|
$TMessage[] ="champs vide";
|
|
|
|
|
$TMessage[] ="Empty fields";
|
|
|
|
|
$texte="";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($texte != filter_var($texte, FILTER_SANITIZE_STRING))
|
|
|
|
|
{
|
|
|
|
|
$TMessage[] ="testative d'injection de code (attaque sécurité)";
|
|
|
|
|
$TMessage[]="Attempt to inject code (security attack)";
|
|
|
|
|
$texte="";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static function val_form_mdp(string &$mdp, array &$TMessage) {
|
|
|
|
|
static function val_form_mdp(&$mdp, &$TMessage) {
|
|
|
|
|
if (!isset($mdp)||$mdp=="") {
|
|
|
|
|
$TMessage[] ="pas de mdp";
|
|
|
|
|
$TMessage[] ="Password not specified";
|
|
|
|
|
$mdp="";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($mdp != filter_var($mdp, FILTER_SANITIZE_SPECIAL_CHARS))
|
|
|
|
|
{
|
|
|
|
|
$TMessage[] ="Le mot de passe ne doit pas contenir de caractères spéciaux";
|
|
|
|
|
$TMessage[] ="Password must not contain special characters";
|
|
|
|
|
$mdp="";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|