Aleksander Machniak
2012-11-08 a92582f3b84157a2f5cc04d82f7e6d2f19b80fa5
Fix AREA links handling (#1488792)

Conflicts:

CHANGELOG
3 files modified
11 ■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/lib/washtml.php 2 ●●● patch | view | raw | blame | history
program/steps/mail/func.inc 8 ●●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Fix AREA links handling (#1488792)
- Fix possible HTTP DoS on error in keep-alive requests (#1488782)
- Fix compatybility with MDB2 2.5.0b4 (#1488779)
- Fix a bug where saving a message in INBOX wasn't possible
program/lib/washtml.php
@@ -102,7 +102,7 @@
    'cellpadding', 'valign', 'bgcolor', 'color', 'border', 'bordercolorlight',
    'bordercolordark', 'face', 'marginwidth', 'marginheight', 'axis', 'border',
    'abbr', 'char', 'charoff', 'clear', 'compact', 'coords', 'vspace', 'hspace',
    'cellborder', 'size', 'lang', 'dir', 'usemap',
    'cellborder', 'size', 'lang', 'dir', 'usemap', 'shape',
    // attributes of form elements
    'type', 'rows', 'cols', 'disabled', 'readonly', 'checked', 'multiple', 'value'
  );
program/steps/mail/func.inc
@@ -1234,7 +1234,7 @@
  // modify HTML links to open a new window if clicked
  $GLOBALS['rcmail_html_container_id'] = $container_id;
  $body = preg_replace_callback('/<(a|link)\s+([^>]+)>/Ui', 'rcmail_alter_html_link', $body);
  $body = preg_replace_callback('/<(a|link|area)\s+([^>]+)>/Ui', 'rcmail_alter_html_link', $body);
  unset($GLOBALS['rcmail_html_container_id']);
  $body = preg_replace(array(
@@ -1347,7 +1347,11 @@
    $attrib['target'] = '_blank';
  }
  return "<$tag" . html::attrib_string($attrib, array('href','name','target','onclick','id','class','style','title','rel','type','media')) . $end;
  // allowed attributes for a|link|area tags
  $allow = array('href','name','target','onclick','id','class','style','title',
    'rel','type','media','alt','coords','nohref','hreflang','shape');
  return "<$tag" . html::attrib_string($attrib, $allow) . $end;
}