system_update_1019

Definition

system_update_1019()
system/system.install, line 3463

Description

Change variable format for user-defined e-mails.

Code

<?php
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();
}
?>