diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-12-22 10:32:04 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-12-22 10:32:04 +0000 |
| commit | 802c1fa128315c0bb7dc8ec26b47b506bfe70d7d (patch) | |
| tree | 9ec4fb9a8647f4a2e558c0deb03c7484bd6857ae /roundcubemail/program | |
| parent | ded4c7c6a34c9779d12555765d13d91ccd3e637e (diff) | |
Make emtpy/invalid links non-clickable
git-svn-id: https://svn.roundcube.net/trunk@5639 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
| -rw-r--r-- | roundcubemail/program/steps/mail/func.inc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/roundcubemail/program/steps/mail/func.inc b/roundcubemail/program/steps/mail/func.inc index d44e9c3d5..3784456c7 100644 --- a/roundcubemail/program/steps/mail/func.inc +++ b/roundcubemail/program/steps/mail/func.inc @@ -1231,7 +1231,8 @@ function rcmail_alter_html_link($matches) $end = '>'; // Remove non-printable characters in URL (#1487805) - $attrib['href'] = preg_replace('/[\x00-\x1F]/', '', $attrib['href']); + if ($attrib['href']) + $attrib['href'] = preg_replace('/[\x00-\x1F]/', '', $attrib['href']); if ($tag == 'link' && preg_match('/^https?:\/\//i', $attrib['href'])) { $tempurl = 'tmp-' . md5($attrib['href']) . '.css'; @@ -1246,6 +1247,10 @@ function rcmail_alter_html_link($matches) JS_OBJECT_NAME, JQ($mailto[1].$mailto[3])); } + else if (empty($attrib['href']) && !$attrib['name']) { + $attrib['href'] = './#NOP'; + $attrib['onclick'] = 'return false'; + } else if (!empty($attrib['href']) && $attrib['href'][0] != '#') { $attrib['target'] = '_blank'; } |
