1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
public function update_presentation()
{
if ( isset($_POST['content']) && !empty($_POST['content']) ) {
$presentation = htmlspecialchars($_POST['content']);
if ( RegexControl ::authorizeParagraphe($_POST['content']) ) {
$compteur_mots = str_word_count($presentation);
if ( $compteur_mots >= 30 ) {
if ( $compteur_mots <= 65 ) {
$param = array(
"presentation" => $presentation
);
$this -> homeManager -> update($param);
die("Modification effectuée avec succès !");
}
else {
die("Erreur: nombre de mots supérieur à la limite autorisée (65 max)");
}
}
else {
die("Erreur: nombre de mots insuffisants (" . $compteur_mots . "). Le texte doit contenir au moins 30 mots");
}
}
}
else {
die("Erreur: la variable est vide et/ou n'existe pas");
}
} |