From 3eb5898f7b8f8b836b15dcb9c9a9213d7edbda96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Mon, 24 Mar 2014 15:35:07 +0100 Subject: [PATCH] use \OC_Mail::validateAddress() to validate the email address - fixes #7862 --- lib/private/mail.php | 2 +- lib/public/util.php | 2 +- settings/ajax/lostpassword.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/private/mail.php b/lib/private/mail.php index f691fda979..79f5160963 100644 --- a/lib/private/mail.php +++ b/lib/private/mail.php @@ -125,7 +125,7 @@ class OC_Mail { * @param string $emailAddress a given email address to be validated * @return bool */ - public static function ValidateAddress($emailAddress) { + public static function validateAddress($emailAddress) { $emailAddress = self::buildAsciiEmail($emailAddress); return PHPMailer::ValidateAddress($emailAddress); } diff --git a/lib/public/util.php b/lib/public/util.php index 5cc7f0f467..f02213f244 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -266,7 +266,7 @@ class Util { $host_name = \OC_Config::getValue('mail_domain', $host_name); $defaultEmailAddress = $user_part.'@'.$host_name; - if (\OC_Mail::ValidateAddress($defaultEmailAddress)) { + if (\OC_Mail::validateAddress($defaultEmailAddress)) { return $defaultEmailAddress; } diff --git a/settings/ajax/lostpassword.php b/settings/ajax/lostpassword.php index b5f47bbcea..88c2bee614 100644 --- a/settings/ajax/lostpassword.php +++ b/settings/ajax/lostpassword.php @@ -6,7 +6,7 @@ OCP\JSON::callCheck(); $l=OC_L10N::get('core'); // Get data -if( isset( $_POST['email'] ) && filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL) ) { +if( isset( $_POST['email'] ) && OC_Mail::validateAddress($_POST['email']) ) { $email=trim($_POST['email']); OC_Preferences::setValue(OC_User::getUser(), 'settings', 'email', $email); OC_JSON::success(array("data" => array( "message" => $l->t("Email saved") )));