Browse Source

Espace de démonstration : problème accents dans l'email

prodstable
keun 7 years ago
parent
commit
d92c188006
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      backend/controllers/CronController.php

+ 9
- 2
backend/controllers/CronController.php View File



$u->nom = $nom ; $u->nom = $nom ;
$u->prenom = $prenom ; $u->prenom = $prenom ;
$u->email = strtolower($prenom).'.'.strtolower($nom).'@yopmail.com' ;
$email = strtolower($prenom).'.'.strtolower($nom).'@yopmail.com' ;
$email = htmlentities($email, ENT_NOQUOTES, 'utf-8');
$email = preg_replace('#&([A-za-z])(?:acute|cedil|caron|circ|grave|orn|ring|slash|th|tilde|uml);#', '\1', $email);
$email = preg_replace('#&([A-za-z]{2})(?:lig);#', '\1', $email); // pour les ligatures e.g. 'œ'
$email = preg_replace('#&[^;]+;#', '', $email); // supprime les autres caractères
$u->email = $email ;
$u->telephone = '0600000000' ; $u->telephone = '0600000000' ;
} }
else { else {
$u->password_hash = '$2y$13$2D5T3Eo0pySmtlAuEGcfmOdTR5mleog8Y6YPGhop/ych6pbj6aN2y' ; $u->password_hash = '$2y$13$2D5T3Eo0pySmtlAuEGcfmOdTR5mleog8Y6YPGhop/ych6pbj6aN2y' ;
} }
$u->save() ;
$u->save()
} }
} }
} }

Loading…
Cancel
Save