Changeset 2938 for branches


Ignore:
Timestamp:
06/17/10 09:49:54 (14 years ago)
Author:
amuller
Message:

Ticket #818 - Remove a validação equívocada

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/expressoMail1_2/inc/class.phpmailer.php

    r1247 r2938  
    525525        for($i = 0; $i < count($this->to); $i++) 
    526526        { 
    527             if($this->valEm($this->to[$i][0])) 
    528             { 
    529                 if(!$this->smtp->Recipient($this->to[$i][0]))  $bad_rcpt[] = $this->to[$i][0]; 
    530             } 
    531             else 
    532             { 
    533                 $errorx .= $this->to[$i][0] . ', '; 
    534             } 
     527                if(!$this->smtp->Recipient($this->to[$i][0])) 
     528                        $bad_rcpt[] = $this->to[$i][0]; 
    535529        } 
    536530        for($i = 0; $i < count($this->cc); $i++) 
    537531        { 
    538             if($this->valEm($this->cc[$i][0])) 
    539             { 
    540                 if(!$this->smtp->Recipient($this->cc[$i][0])) $bad_rcpt[] = $this->cc[$i][0]; 
    541             } 
    542                         else 
    543             { 
    544                 $errorx .= $this->cc[$i][0] . ', '; 
    545             } 
     532                if(!$this->smtp->Recipient($this->cc[$i][0])) 
     533                        $bad_rcpt[] = $this->cc[$i][0]; 
    546534        } 
    547535        for($i = 0; $i < count($this->bcc); $i++) 
    548536        { 
    549             if($this->valEm($this->bcc[$i][0])) 
    550             { 
    551                 if(!$this->smtp->Recipient($this->bcc[$i][0])) $bad_rcpt[] = $this->bcc[$i][0]; 
    552             } 
    553                         else 
    554             { 
    555                 $errorx .= $this->bcc[$i][0] . ', '; 
    556             } 
     537                if(!$this->smtp->Recipient($this->bcc[$i][0])) 
     538                        $bad_rcpt[] = $this->bcc[$i][0];       
    557539        } 
    558540        if($errorx != '') 
     
    726708         
    727709        return $smtpSent; 
    728     } 
    729  
    730     function valEm($email) 
    731     { 
    732         $mail_retorno = FALSE; 
    733         if ((strlen($email) >= 6) && (substr_count($email,"@") == 1) && (substr($email,0,1) != "@") && (substr($email,strlen($email)-1,1) != "@")) 
    734         { 
    735             if ((!strstr($email,"'")) && (!strstr($email,"\"")) && (!strstr($email,"\\")) && (!strstr($email,"\$")) && (!strstr($email," "))) 
    736             { 
    737                 //testa se tem caracter . 
    738                 if (substr_count($email,".")>= 1) 
    739                 { 
    740                     //obtem a terminação do dominio 
    741                     $term_dom = substr(strrchr ($email, '.'),1); 
    742                     //verifica se terminação do dominio esta correcta 
    743                     if (strlen($term_dom)>1 && strlen($term_dom)<5 && (!strstr($term_dom,"@")) ) 
    744                     { 
    745                         $antes_dom = substr($email,0,strlen($email) - strlen($term_dom) - 1); 
    746                         $caracter_ult = substr($antes_dom,strlen($antes_dom)-1,1); 
    747                         if ($caracter_ult != "@" && $caracter_ult != ".") 
    748                         { 
    749                             $mail_retorno = TRUE; 
    750                         } 
    751                     } 
    752                 } 
    753             } 
    754         } 
    755         return $mail_retorno; 
    756710    } 
    757711 
Note: See TracChangeset for help on using the changeset viewer.