X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fmail.php;h=ab22de404c421581f4043e1578a4c641912ddcbc;hb=1d29ba83150bdd7a23e497ca9a743ac2b6158b6f;hp=dd6a1a366e80ac75126a2040aa20774219151b54;hpb=76946ea5a3636479d713f64471e86643936bc540;p=quix0rs-gnu-social.git diff --git a/lib/mail.php b/lib/mail.php index dd6a1a366e..ab22de404c 100644 --- a/lib/mail.php +++ b/lib/mail.php @@ -44,7 +44,6 @@ require_once 'Mail.php'; * * @return Mail backend */ - function mail_backend() { static $backend = null; @@ -70,7 +69,6 @@ function mail_backend() * * @return boolean success flag */ - function mail_send($recipients, $headers, $body) { // XXX: use Mail_Queue... maybe @@ -94,7 +92,6 @@ function mail_send($recipients, $headers, $body) * * @return string mail domain, suitable for making email addresses. */ - function mail_domain() { $maildomain = common_config('mail', 'domain'); @@ -112,7 +109,6 @@ function mail_domain() * * @return string notify from address */ - function mail_notify_from() { $notifyfrom = common_config('mail', 'notifyfrom'); @@ -121,7 +117,7 @@ function mail_notify_from() $domain = mail_domain(); - $notifyfrom = '"'.common_config('site', 'name') .'" '; + $notifyfrom = '"'. str_replace('"', '\\"', common_config('site', 'name')) .'" '; } return $notifyfrom; @@ -138,7 +134,6 @@ function mail_notify_from() * * @return boolean success flag */ - function mail_to_user(&$user, $subject, $body, $headers=array(), $address=null) { if (!$address) { @@ -167,9 +162,12 @@ function mail_to_user(&$user, $subject, $body, $headers=array(), $address=null) * * @return success flag */ - -function mail_confirm_address($user, $code, $nickname, $address) +function mail_confirm_address($user, $code, $nickname, $address, $url=null) { + if (empty($url)) { + $url = common_local_url('confirmaddress', array('code' => $code)); + } + // TRANS: Subject for address confirmation email. $subject = _('Email address confirmation'); @@ -184,7 +182,8 @@ function mail_confirm_address($user, $code, $nickname, $address) "Thanks for your time, \n%2\$s\n"), $nickname, common_config('site', 'name'), - common_local_url('confirmaddress', array('code' => $code))); + $url); + $headers = array(); return mail_to_user($user, $subject, $body, $headers, $address); @@ -202,7 +201,6 @@ function mail_confirm_address($user, $code, $nickname, $address) * * @return void */ - function mail_subscribe_notify($listenee, $listener) { $other = $listener->getProfile(); @@ -220,7 +218,6 @@ function mail_subscribe_notify($listenee, $listener) * * @return void */ - function mail_subscribe_notify_profile($listenee, $other) { if ($other->hasRight(Right::EMAILONSUBSCRIBE) && @@ -490,7 +487,7 @@ function mail_notify_nudge($from, $to) common_switch_locale($to->language); // TRANS: Subject for 'nudge' notification email. // TRANS: %s is the nudging user. - $subject = sprintf(_('You\'ve been nudged by %s'), $from->nickname); + $subject = sprintf(_('You have been nudged by %s'), $from->nickname); $from_profile = $from->getProfile();