summaryrefslogtreecommitdiffstats
path: root/lib/public
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2015-02-19 18:55:27 +0100
committerLukas Reschke <lukas@owncloud.com>2015-03-16 12:47:05 +0100
commitf92f3a1a6ecbce06fbe24204ef12b2eeeb0f0d15 (patch)
treedca224d1136cae6d5a971cd110a0591ce0d8d1ef /lib/public
parent283476a2f7c200912352eb4db097f540e3993e75 (diff)
downloadnextcloud-server-f92f3a1a6ecbce06fbe24204ef12b2eeeb0f0d15.tar.gz
nextcloud-server-f92f3a1a6ecbce06fbe24204ef12b2eeeb0f0d15.zip
Incorporate review changes
Diffstat (limited to 'lib/public')
-rw-r--r--lib/public/mail/imailer.php8
-rw-r--r--lib/public/mail/util.php26
-rw-r--r--lib/public/util.php3
3 files changed, 10 insertions, 27 deletions
diff --git a/lib/public/mail/imailer.php b/lib/public/mail/imailer.php
index 2a20ead612b..dc6fe5ba869 100644
--- a/lib/public/mail/imailer.php
+++ b/lib/public/mail/imailer.php
@@ -46,4 +46,12 @@ interface IMailer {
* has been supplied.)
*/
public function send(Message $message);
+
+ /**
+ * Checks if an e-mail address is valid
+ *
+ * @param string $email Email address to be validated
+ * @return bool True if the mail address is valid, false otherwise
+ */
+ public function validateMailAddress($email);
}
diff --git a/lib/public/mail/util.php b/lib/public/mail/util.php
deleted file mode 100644
index ea59649e620..00000000000
--- a/lib/public/mail/util.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * Copyright (c) 2014 Lukas Reschke <lukas@owncloud.com>
- * This file is licensed under the Affero General Public License version 3 or
- * later.
- * See the COPYING-README file.
- */
-
-namespace OCP\Mail;
-
-/**
- * Class Util provides some helpers for mail addresses
- *
- * @package OCP\Mail
- */
-class Util {
- /**
- * Checks if an e-mail address is valid
- *
- * @param string $email Email address to be validated
- * @return bool True if the mail address is valid, false otherwise
- */
- public static function validateMailAddress($email) {
- return \OC\Mail\Util::validateMailAddress($email);
- }
-}
diff --git a/lib/public/util.php b/lib/public/util.php
index 71ab8cabce5..338c216f255 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -294,7 +294,8 @@ class Util {
$host_name = \OC_Config::getValue('mail_domain', $host_name);
$defaultEmailAddress = $user_part.'@'.$host_name;
- if (\OCP\Mail\Util::validateMailAddress($defaultEmailAddress)) {
+ $mailer = \OC::$server->getMailer();
+ if ($mailer->validateMailAddress($defaultEmailAddress)) {
return $defaultEmailAddress;
}