Index: branches/5.3.x/core/kernel/utility/email.php =================================================================== diff -u -N -r15916 -r15918 --- branches/5.3.x/core/kernel/utility/email.php (.../email.php) (revision 15916) +++ branches/5.3.x/core/kernel/utility/email.php (.../email.php) (revision 15918) @@ -1,6 +1,6 @@ _changeLanguage(false); // 1. set headers - $message_headers = $this->_getHeaders(); + try { + $message_headers = $this->_getHeaders(); + } + catch ( Exception $e ) { + trigger_error('Error parsing e-mail message headers', E_USER_WARNING); + + return false; + } + $message_subject = isset($message_headers['Subject']) ? $message_headers['Subject'] : 'Mail message'; $this->sender->SetSubject($message_subject); @@ -255,9 +263,16 @@ } // 3. set body - $html_message_body = $this->_getMessageBody(true); - $plain_message_body = $this->_getMessageBody(false); + try { + $html_message_body = $this->_getMessageBody(true); + $plain_message_body = $this->_getMessageBody(false); + } + catch ( Exception $e ) { + trigger_error('Error parsing e-mail message body', E_USER_WARNING); + return false; + } + if ( $html_message_body === false && $plain_message_body === false ) { trigger_error('Message template is empty (maybe after parsing).', E_USER_WARNING); @@ -859,4 +874,4 @@ { return preg_replace('/(\n|\r)+/', "\\1", $text); } -} \ No newline at end of file +} Index: branches/5.3.x/core/units/email_templates/email_template_eh.php =================================================================== diff -u -N -r15916 -r15918 --- branches/5.3.x/core/units/email_templates/email_template_eh.php (.../email_template_eh.php) (revision 15916) +++ branches/5.3.x/core/units/email_templates/email_template_eh.php (.../email_template_eh.php) (revision 15918) @@ -1,6 +1,6 @@ Application->GetVar('module'); if ( strlen($module) > 0 ) { - // checking permission when lising module email events in separate section + // checking permission when listing module email events in separate section $module = explode(':', $module, 2); if ( count($module) == 1 ) {