[SPIP] ~v3.0.20-->v3.0.25
[lhc/web/clavette_www.git] / www / plugins-dist / forum / formulaires / forum_prive.php
index 9f3d437..56948f7 100644 (file)
@@ -3,7 +3,7 @@
 /***************************************************************************\
  *  SPIP, Systeme de publication pour l'internet                           *
  *                                                                         *
- *  Copyright (c) 2001-2014                                                *
+ *  Copyright (c) 2001-2016                                                *
  *  Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James  *
  *                                                                         *
  *  Ce programme est un logiciel libre distribue sous licence GNU/GPL.     *
@@ -73,8 +73,12 @@ function formulaires_forum_prive_verifier_dist($objet, $id_objet, $id_forum, $af
 
        $erreurs = array();
 
-       if (strlen($texte = _request('texte')) < 10 AND $GLOBALS['meta']['forums_texte'] == 'oui')
-               $erreurs['texte'] = _T('forum:forum_attention_dix_caracteres');
+       $min_length = (defined('_FORUM_LONGUEUR_MINI') ? _FORUM_LONGUEUR_MINI : 10);
+       if (strlen($texte = _request('texte'))<$min_length
+               AND !$ajouter_mot AND $GLOBALS['meta']['forums_texte']=='oui'
+       ){
+               $erreurs['texte'] = _T($min_length==10 ? 'forum:forum_attention_dix_caracteres' : 'forum:forum_attention_nb_caracteres_mini', array('min' => $min_length));
+       }
        else if (defined('_FORUM_LONGUEUR_MAXI')
        AND _FORUM_LONGUEUR_MAXI > 0
        AND strlen($texte) > _FORUM_LONGUEUR_MAXI)
@@ -83,7 +87,6 @@ function formulaires_forum_prive_verifier_dist($objet, $id_objet, $id_forum, $af
                                'compte' => strlen($texte),
                                'max' => _FORUM_LONGUEUR_MAXI
                        ));
-
        if (strlen($titre=_request('titre')) < 3
        AND $GLOBALS['meta']['forums_titre'] == 'oui')
                $erreurs['titre'] = _T('forum:forum_attention_trois_caracteres');