File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ function qa_send_email($params)
135135
136136 require_once QA_INCLUDE_DIR . 'vendor/PHPMailer/PHPMailerAutoload.php ' ;
137137
138+ PHPMailer::$ validator = 'php ' ;
138139 $ mailer = new PHPMailer ();
139140 $ mailer ->CharSet = 'utf-8 ' ;
140141
Original file line number Diff line number Diff line change @@ -736,7 +736,7 @@ function qa_email_validate($email)
736736{
737737 if (qa_to_override (__FUNCTION__ )) { $ args =func_get_args (); return qa_call_override (__FUNCTION__ , $ args ); }
738738
739- return preg_match ( " /^[\-\!\# \$ \%\&\'\*\+\/\=\?\_\`\{\|\}\~a-zA-Z0-9\.\^]+\@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\.\-]+$/ " , $ email ) === 1 ;
739+ return ( bool ) filter_var ( $ email , FILTER_VALIDATE_EMAIL ) ;
740740}
741741
742742
Original file line number Diff line number Diff line change @@ -126,13 +126,14 @@ public function test__qa_email_validate()
126126 $ goodEmails = array (
127127 'hello@example.com ' ,
128128 'q.a@question2answer.org ' ,
129- 'example@newdomain.app '
129+ 'example@newdomain.app ' ,
130130 );
131131 $ badEmails = array (
132132 'nobody@nowhere ' ,
133133 'pokémon@example.com ' ,
134134 'email @ with spaces ' ,
135135 'some random string ' ,
136+ 'dotbeforeat.@email.com ' ,
136137 );
137138
138139 foreach ($ goodEmails as $ email ) {
You can’t perform that action at this time.
0 commit comments