コード例 #1
0
ファイル: ae_ValidateTest.php プロジェクト: sebadorn/aestas3
 public function testValidateEmail()
 {
     $this->assertTrue(ae_Validate::emailSloppy('*****@*****.**'));
     $this->assertTrue(ae_Validate::emailSloppy('exämple_ß14@example.com'));
     $this->assertFalse(ae_Validate::emailSloppy('example.com'));
     $this->assertFalse(ae_Validate::emailSloppy("exa\tmp\nle.com"));
     $this->assertFalse(ae_Validate::emailSloppy('exämpleß.com'));
     $this->assertFalse(ae_Validate::emailSloppy('example@example@example.com'));
     $this->assertFalse(ae_Validate::emailSloppy(TRUE));
 }
コード例 #2
0
ファイル: ae_CommentModel.php プロジェクト: sebadorn/aestas3
 /**
  * Set the author email.
  * @param  {string}    $email The author email. Can either be empty or a valid email.
  * @throws {Exception}        If neither empty nor valid.
  */
 public function setAuthorEmail($email)
 {
     $email = trim($email);
     if ($email !== '' && !ae_Validate::emailSloppy($email)) {
         $msg = sprintf('[%s] Not a valid eMail: %s', get_class(), htmlspecialchars($email));
         throw new Exception($msg);
     }
     $this->authorEmail = $email;
 }