Changeset 48115 in spip-zone for _plugins_/nospam/nospam_pipelines.php
- Timestamp:
- May 25, 2011, 8:24:25 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/nospam/nospam_pipelines.php
r43661 r48115 2 2 /** 3 3 * Plugin No-SPAM 4 * (c) 2008 Cedric Morin Yterium.net4 * (c) 2008-2011 Cedric Morin Yterium.net 5 5 * Licence GPL 6 6 * 7 7 */ 8 8 9 // pour verifier le nobot et le jeton sur un formulaire, l'ajouter a cette globale 10 $GLOBALS['formulaires_no_spam'][] = 'forum'; 11 $GLOBALS['formulaires_no_spam'][] = 'ecrire_auteur'; 12 $GLOBALS['formulaires_no_spam'][] = 'signature'; 13 9 /** 10 * Lister les formulaires a prendre en charge contre le SPAM 11 * pour verifier le nobot et le jeton sur un formulaire, l'ajouter a cette liste 12 * par le pipeline nospam_lister_formulaires 13 * @return void 14 */ 15 function nospam_lister_formulaires(){ 16 if (!isset($GLOBALS['formulaires_no_spam'])) 17 $GLOBALS['formulaires_no_spam'] = array(); 18 $formulaires = array_merge($GLOBALS['formulaires_no_spam'],array('forum','ecrire_auteur','signature')); 19 return pipeline('nospam_lister_formulaires',$formulaires); 20 } 14 21 15 22 /** … … 24 31 if (false !== $pos = strpos($fond, 'formulaires/')) { 25 32 $form = substr($fond, $pos + 12); 26 if (in_array($form, $GLOBALS['formulaires_no_spam'])){33 if (in_array($form, nospam_lister_formulaires())){ 27 34 // on ajoute le champ 'nobot' si pas present dans le formulaire 28 35 $texte = &$flux['data']['texte']; … … 45 52 function nospam_formulaire_charger($flux){ 46 53 $form = $flux['args']['form']; 47 if (in_array($form, $GLOBALS['formulaires_no_spam'])){54 if (in_array($form, nospam_lister_formulaires())){ 48 55 include_spip("inc/nospam"); 49 56 $jeton = creer_jeton($form); … … 61 68 function nospam_formulaire_verifier($flux){ 62 69 $form = $flux['args']['form']; 63 if (in_array($form, $GLOBALS['formulaires_no_spam'])){70 if (in_array($form, nospam_lister_formulaires())){ 64 71 include_spip("inc/nospam"); 65 72 $jeton = _request('_jeton');
Note: See TracChangeset
for help on using the changeset viewer.