From 43aeb195c159cac8352f1eeb5148c060ff0b81b6 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Fri, 01 Feb 2013 14:08:16 -0500 Subject: [PATCH] Fix handling link href attribute value with (valid) newline characters (#1488940) --- 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 715c460..2a26141 100644 --- a/program/lib/Roundcube/rcube_washtml.php +++ b/program/lib/Roundcube/rcube_washtml.php @@ -240,7 +240,8 @@ $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) . '"'; -- Gitblit v1.9.1