Index: upgrades.php =================================================================== --- upgrades.php (revision 14103) +++ upgrades.php (working copy) @@ -227,11 +227,13 @@ ' ' $new_tag) { - $sql = 'UPDATE '.TABLE_PREFIX.'EmailMessage - SET Template = REPLACE(Template, '.$this->Conn->qstr($old_tag).', '.$this->Conn->qstr($new_tag).') - WHERE EventId IN ('.$event_ids.')'; - $this->Conn->Query($sql); + if ($event_ids) { + foreach ($replacements as $old_tag => $new_tag) { + $sql = 'UPDATE '.TABLE_PREFIX.'EmailMessage + SET Template = REPLACE(Template, '.$this->Conn->qstr($old_tag).', '.$this->Conn->qstr($new_tag).') + WHERE EventId IN ('.$event_ids.')'; + $this->Conn->Query($sql); + } } if ($mode == 'after') {