summaryrefslogtreecommitdiff
path: root/lib/mail.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-05-25 11:36:42 -0700
committerBrion Vibber <brion@pobox.com>2010-05-25 11:36:42 -0700
commitf98609204fb9b5966b9e4c9e4bf8bf605656c31c (patch)
tree8cc16bb846e31670ce64adb3574f67c54818dc16 /lib/mail.php
parent09dab2ce5ae819c73d7984822d418c43f1fba223 (diff)
Backing out locale switch change to see if this affects our mystery memory leak.
Revert "Locale switch cleanup: use common_switch_locale() which is safer for updating gettext state. Also moved a few calls to reduce chance of hitting an exception before switching back." This reverts commit 74a89b1fc37067d91d31bd66922053361eb4e616.
Diffstat (limited to 'lib/mail.php')
-rw-r--r--lib/mail.php20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/mail.php b/lib/mail.php
index ab5742e33..f45b2d333 100644
--- a/lib/mail.php
+++ b/lib/mail.php
@@ -224,6 +224,9 @@ function mail_subscribe_notify_profile($listenee, $other)
if ($other->hasRight(Right::EMAILONSUBSCRIBE) &&
$listenee->email && $listenee->emailnotifysub) {
+ // use the recipient's localization
+ common_init_locale($listenee->language);
+
$profile = $listenee->getProfile();
$name = $profile->getBestName();
@@ -233,9 +236,6 @@ function mail_subscribe_notify_profile($listenee, $other)
$recipients = $listenee->email;
- // use the recipient's localization
- common_switch_locale($listenee->language);
-
$headers = _mail_prepare_headers('subscribe', $listenee->nickname, $other->nickname);
$headers['From'] = mail_notify_from();
$headers['To'] = $name . ' <' . $listenee->email . '>';
@@ -277,7 +277,7 @@ function mail_subscribe_notify_profile($listenee, $other)
common_local_url('emailsettings'));
// reset localization
- common_switch_locale();
+ common_init_locale();
mail_send($recipients, $headers, $body);
}
}
@@ -479,7 +479,7 @@ function mail_confirm_sms($code, $nickname, $address)
function mail_notify_nudge($from, $to)
{
- common_switch_locale($to->language);
+ common_init_locale($to->language);
// TRANS: Subject for 'nudge' notification email
$subject = sprintf(_('You\'ve been nudged by %s'), $from->nickname);
@@ -497,7 +497,7 @@ function mail_notify_nudge($from, $to)
$from->nickname,
common_local_url('all', array('nickname' => $to->nickname)),
common_config('site', 'name'));
- common_switch_locale();
+ common_init_locale();
$headers = _mail_prepare_headers('nudge', $to->nickname, $from->nickname);
@@ -531,7 +531,7 @@ function mail_notify_message($message, $from=null, $to=null)
return true;
}
- common_switch_locale($to->language);
+ common_init_locale($to->language);
// TRANS: Subject for direct-message notification email
$subject = sprintf(_('New private message from %s'), $from->nickname);
@@ -555,7 +555,7 @@ function mail_notify_message($message, $from=null, $to=null)
$headers = _mail_prepare_headers('message', $to->nickname, $from->nickname);
- common_switch_locale();
+ common_init_locale();
return mail_to_user($to, $subject, $body, $headers);
}
@@ -583,7 +583,7 @@ function mail_notify_fave($other, $user, $notice)
$bestname = $profile->getBestName();
- common_switch_locale($other->language);
+ common_init_locale($other->language);
// TRANS: Subject for favorite notification email
$subject = sprintf(_('%s (@%s) added your notice as a favorite'), $bestname, $user->nickname);
@@ -611,7 +611,7 @@ function mail_notify_fave($other, $user, $notice)
$headers = _mail_prepare_headers('fave', $other->nickname, $user->nickname);
- common_switch_locale();
+ common_init_locale();
mail_to_user($other, $subject, $body, $headers);
}