summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-12-22 10:32:04 +0000
committerthomascube <thomas@roundcube.net>2011-12-22 10:32:04 +0000
commitc8c53f4ad1b4759841ab929eb4b3e770c5132eb1 (patch)
tree5a8b7bee1e43c935747b20d6d344996dcd4d7f29 /program
parentc886de7ff41b8e0495e3c89a0b5912a6ec5c44d2 (diff)
Make emtpy/invalid links non-clickable
Diffstat (limited to 'program')
-rw-r--r--program/steps/mail/func.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index d44e9c3d5..3784456c7 100644
--- a/program/steps/mail/func.inc
+++ b/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';
}