Changeset 75280 in spip-zone


Ignore:
Timestamp:
Sep 5, 2013, 10:26:41 AM (6 years ago)
Author:
cedric@…
Message:

On abonne jamais ni n'importe d'email sous la forme md5@… (l'imagination des utilisateurs est sans limite)

Location:
_plugins_/mailsubscribers/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/mailsubscribers/trunk/formulaires/importer_mailsubscribers.php

    r69690 r75280  
    196196                // mais graceful (sans forcer le reabonnement d'un desabonne)
    197197                $email = $d['email'];
    198                 if (email_valide($email)){
     198                if (email_valide($email) AND !mailsubscribers_test_email_obfusque($email)){
    199199                        $set = array();
    200200                        if (isset($d['nom'])) $set['nom'] = $d['nom'];
  • _plugins_/mailsubscribers/trunk/inc/mailsubscribers.php

    r69691 r75280  
    3737function mailsubscribers_obfusquer_email($email){
    3838        return md5($email)."@example.org";
     39}
     40
     41function mailsubscribers_test_email_obfusque($email){
     42        return preg_match(",^[a-f0-9]+@example.org$,",$email);
    3943}
    4044
  • _plugins_/mailsubscribers/trunk/newsletter/subscribe.php

    r69691 r75280  
    1212include_spip('inc/mailsubscribers');
    1313include_spip('inc/config');
     14include_spip('inc/filtres');
    1415include_spip('inc/autoriser');
    1516
     
    3940
    4041        if (!$email = trim($email)) return false;
     42        // on abonne pas un email invalide ou obfusque !
     43        if (!email_valide($email) OR mailsubscribers_test_email_obfusque($email)){
     44                spip_log("email invalide pour abonnement : $email","mailsubscribers."._LOG_INFO_IMPORTANTE);
     45                return false;
     46        }
    4147
    4248        $set = array();
  • _plugins_/mailsubscribers/trunk/paquet.xml

    r75267 r75280  
    22        prefix="mailsubscribers"
    33        categorie="communication"
    4         version="1.3.2"
     4        version="1.3.3"
    55        etat="stable"
    66        compatibilite="[3.0.0;3.0.*]"
Note: See TracChangeset for help on using the changeset viewer.