summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-12-13 10:41:56 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-12-13 10:41:56 +0000
commit4032bc9ea2cd6d303f126e0365f80db7564ffb98 (patch)
tree27e1dab0ec5c5d2652891b153184ee1c1fa6241c
parenta043194e3fd94ca861adf479b9e02cd41d2cb144 (diff)
downloadbrdo-4032bc9ea2cd6d303f126e0365f80db7564ffb98.tar.gz
brdo-4032bc9ea2cd6d303f126e0365f80db7564ffb98.tar.bz2
#102644: Change %var to !var in user-defined e-mails (e.g. welcome mail)
-rw-r--r--modules/system/system.install18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/system/system.install b/modules/system/system.install
index 475613d7c..e93a5fb10 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -3463,6 +3463,24 @@ function system_update_1018() {
}
/**
+ * Change variable format for user-defined e-mails.
+ */
+function system_update_1019() {
+ $message_ids = array('welcome_subject', 'welcome_body',
+ 'approval_subject', 'approval_body',
+ 'pass_subject', 'pass_body',
+ );
+ foreach ($message_ids as $id) {
+ // Replace all %vars with !vars
+ if ($message = variable_get('user_mail_'. $id, NULL)) {
+ $fixed = preg_replace('/%([A-Za-z_-]+)/', '!\1', $message);
+ variable_set('user_mail_'. $id, $fixed);
+ }
+ }
+ return array();
+}
+
+/**
* @} End of "defgroup updates-4.7-to-5.0"
*/