diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-02-01 20:04:00 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-02-01 20:04:00 +0100 |
commit | 1f910cb50dcb12e84d92db4d61dcd8dbb0f0c5b6 (patch) | |
tree | 1107e0fce45d40297e6bd055521d724230c05e8d /program/lib/Roundcube | |
parent | 8bfbd5e9f9c1d2c4657bda2f6099f01fc8097846 (diff) |
Fix handling link href attribute value with (valid) newline characters (#1488940)
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r-- | program/lib/Roundcube/rcube_washtml.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/program/lib/Roundcube/rcube_washtml.php b/program/lib/Roundcube/rcube_washtml.php index 715c46047..2a261419f 100644 --- a/program/lib/Roundcube/rcube_washtml.php +++ b/program/lib/Roundcube/rcube_washtml.php @@ -240,7 +240,8 @@ class rcube_washtml $value = $node->getAttribute($key); if (isset($this->_html_attribs[$key]) || - ($key == 'href' && !preg_match('!^(javascript|vbscript|data:text)!i', $value) + ($key == 'href' && ($value = trim($value)) + && !preg_match('!^(javascript|vbscript|data:text)!i', $value) && preg_match('!^([a-z][a-z0-9.+-]+:|//|#).+!i', $value)) ) { $t .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES) . '"'; |