alecpl
2008-09-17 7f62581c10435b319806ffec786d3b8389126574
- Smart Tags and NOBR tag support in html messages (#1485363, #1485327)


3 files modified
14 ■■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/lib/washtml.php 2 ●●● patch | view | raw | blame | history
program/steps/mail/func.inc 11 ●●●●● patch | view | raw | blame | history
CHANGELOG
@@ -9,6 +9,7 @@
- Added icons for forwarded/forwarded+replied messages (#1485257)
- Added Reply-To to forwarded emails (#1485315)
- Display progress message for folders create/delete/rename (#1485357)
- Smart Tags and NOBR tag support in html messages (#1485363, #1485327)
2008/09/15 (thomasb)
----------
program/lib/washtml.php
@@ -74,7 +74,7 @@
class washtml
{
  /* Allowed HTML elements (default) */
  static $html_elements = array('a', 'abbr', 'acronym', 'address', 'area', 'b', 'basefont', 'bdo', 'big', 'blockquote', 'br', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'fieldset', 'font', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'ins', 'label', 'legend', 'li', 'map', 'menu', 'ol', 'p', 'pre', 'q', 's', 'samp', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'u', 'ul', 'var', 'img');
  static $html_elements = array('a', 'abbr', 'acronym', 'address', 'area', 'b', 'basefont', 'bdo', 'big', 'blockquote', 'br', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'fieldset', 'font', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'ins', 'label', 'legend', 'li', 'map', 'menu', 'nobr', 'ol', 'p', 'pre', 'q', 's', 'samp', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'u', 'ul', 'var', 'img');
  
  /* Ignore these HTML tags but process their content */
  static $ignore_elements = array('html', 'head', 'body');
program/steps/mail/func.inc
@@ -611,6 +611,17 @@
    // PHP bug #32547 workaround: remove title tag
    $html = preg_replace('/<title>.*<\/title>/', '', $html);
    // special replacements (not properly handled by washtml class)
    $html_search = array(
    '/(<\/nobr>)(\s+)(<nobr>)/i',    // space(s) between <NOBR>
    '/(<[\/]*st1:[^>]+>)/i',    // Microsoft's Smart Tags <ST1>
    );
    $html_replace = array(
    '\\1'.' &nbsp; '.'\\3',
    '',
    );
    $html = preg_replace($html_search, $html_replace, $html);
    // clean HTML with washhtml by Frederic Motte
    $wash_opts = array(
      'show_washed' => false,