|
|
@ -903,6 +903,15 @@ function rcmail_wash_html($html, $p, $cid_replaces = array())
|
|
|
|
$washer->add_callback('style', 'rcmail_washtml_callback');
|
|
|
|
$washer->add_callback('style', 'rcmail_washtml_callback');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// alter link tag attributes
|
|
|
|
|
|
|
|
if (!$p['skip_washer_link_callback']) {
|
|
|
|
|
|
|
|
$washer->add_callback('a', 'rcmail_washtml_link_callback');
|
|
|
|
|
|
|
|
$washer->add_callback('area', 'rcmail_washtml_link_callback');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($p['safe'])
|
|
|
|
|
|
|
|
$washer->add_callback('link', 'rcmail_washtml_link_callback');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Remove non-UTF8 characters (#1487813)
|
|
|
|
// Remove non-UTF8 characters (#1487813)
|
|
|
|
$html = rcube_charset::clean($html);
|
|
|
|
$html = rcube_charset::clean($html);
|
|
|
|
|
|
|
|
|
|
|
@ -1478,7 +1487,6 @@ function rcmail_html4inline($body, $container_id, $body_class='', &$attributes=a
|
|
|
|
|
|
|
|
|
|
|
|
// modify HTML links to open a new window if clicked
|
|
|
|
// modify HTML links to open a new window if clicked
|
|
|
|
$GLOBALS['rcmail_html_container_id'] = $container_id;
|
|
|
|
$GLOBALS['rcmail_html_container_id'] = $container_id;
|
|
|
|
$body = preg_replace_callback('/<(a|link|area)\s+([^>]+)>/Ui', 'rcmail_alter_html_link', $body);
|
|
|
|
|
|
|
|
unset($GLOBALS['rcmail_html_container_id']);
|
|
|
|
unset($GLOBALS['rcmail_html_container_id']);
|
|
|
|
|
|
|
|
|
|
|
|
$body = preg_replace(array(
|
|
|
|
$body = preg_replace(array(
|
|
|
@ -1566,13 +1574,11 @@ function rcmail_html4inline($body, $container_id, $body_class='', &$attributes=a
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Parse link (a, link, area) attributes and set correct target
|
|
|
|
* Parse link (a, link, area) attributes and set correct target
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function rcmail_alter_html_link($matches)
|
|
|
|
function rcmail_washtml_link_callback($tag, $attribs, $content, $washtml)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
global $RCMAIL;
|
|
|
|
global $RCMAIL;
|
|
|
|
|
|
|
|
|
|
|
|
$tag = strtolower($matches[1]);
|
|
|
|
$attrib = html::parse_attrib_string($attribs);
|
|
|
|
$attrib = html::parse_attrib_string($matches[2]);
|
|
|
|
|
|
|
|
$end = '>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Remove non-printable characters in URL (#1487805)
|
|
|
|
// Remove non-printable characters in URL (#1487805)
|
|
|
|
if ($attrib['href']) {
|
|
|
|
if ($attrib['href']) {
|
|
|
@ -1616,7 +1622,7 @@ function rcmail_alter_html_link($matches)
|
|
|
|
$attrib['onclick'] = '';
|
|
|
|
$attrib['onclick'] = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (empty($attrib['href']) && !$attrib['name']) {
|
|
|
|
else if (empty($attrib['href']) && !isset($attrib['name'])) {
|
|
|
|
$attrib['href'] = './#NOP';
|
|
|
|
$attrib['href'] = './#NOP';
|
|
|
|
$attrib['onclick'] = 'return false';
|
|
|
|
$attrib['onclick'] = 'return false';
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1633,7 +1639,7 @@ function rcmail_alter_html_link($matches)
|
|
|
|
$allow = array('href','name','target','onclick','id','class','style','title',
|
|
|
|
$allow = array('href','name','target','onclick','id','class','style','title',
|
|
|
|
'rel','type','media','alt','coords','nohref','hreflang','shape');
|
|
|
|
'rel','type','media','alt','coords','nohref','hreflang','shape');
|
|
|
|
|
|
|
|
|
|
|
|
return "<$tag" . html::attrib_string($attrib, $allow) . $end;
|
|
|
|
return html::tag($tag, $attrib, $content, $allow);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|