summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-03-04 12:52:35 -0800
committerBernhard Posselt <nukeawhale@gmail.com>2013-03-04 12:52:35 -0800
commit62dde34887b26d91d324d1c1b5be4702721291c4 (patch)
tree598ace6acc887978221750479d124c2850fa0fd9 /lib
parent5c061561c55b5adb6577c4ca2a2b4009b246db6d (diff)
parent6019cdd5bdba8623673299e9ae7b765bef8235a9 (diff)
downloadnextcloud-server-62dde34887b26d91d324d1c1b5be4702721291c4.tar.gz
nextcloud-server-62dde34887b26d91d324d1c1b5be4702721291c4.zip
Merge pull request #2088 from owncloud/fixing-1844-again-master
adding test case for getDefaultEmailAddress() + fixing #1844 again
Diffstat (limited to 'lib')
-rw-r--r--lib/mail.php8
-rw-r--r--lib/public/util.php4
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/mail.php b/lib/mail.php
index 22194045a76..61634632efc 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -119,4 +119,12 @@ class OC_Mail {
return($txt);
}
+
+ /**
+ * @param string $emailAddress a given email address to be validated
+ * @return bool
+ */
+ public static function ValidateAddress($emailAddress) {
+ return PHPMailer::ValidateAddress($emailAddress);
+ }
}
diff --git a/lib/public/util.php b/lib/public/util.php
index 5d814114a24..db07cbcfff3 100644
--- a/lib/public/util.php
+++ b/lib/public/util.php
@@ -219,11 +219,11 @@ class Util {
$host_name = self::getServerHostName();
$defaultEmailAddress = $user_part.'@'.$host_name;
- if (\PHPMailer::ValidateAddress($defaultEmailAddress)) {
+ if (\OC_Mail::ValidateAddress($defaultEmailAddress)) {
return $defaultEmailAddress;
}
- // incase we cannot build a valid email address from the hostname let's fallback to 'localhost.localdomain'
+ // in case we cannot build a valid email address from the hostname let's fallback to 'localhost.localdomain'
return $user_part.'@localhost.localdomain';
}