summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
Diffstat (limited to 'program')
-rw-r--r--program/lib/html2text.php6
-rw-r--r--program/steps/mail/func.inc3
2 files changed, 7 insertions, 2 deletions
diff --git a/program/lib/html2text.php b/program/lib/html2text.php
index 3b98e8df7..325a1c941 100644
--- a/program/lib/html2text.php
+++ b/program/lib/html2text.php
@@ -652,10 +652,12 @@ class html2text
case 'h':
return $this->_strtoupper("\n\n". $matches[2] ."\n\n");
case 'a':
- return $this->_build_link_list($matches[3], $matches[4]);
+ // Remove spaces in URL (#1487805)
+ $url = str_replace(' ', '', $matches[3]);
+ return $this->_build_link_list($url, $matches[4]);
}
}
-
+
/**
* Strtoupper multibyte wrapper function
*
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 9fa1e01fc..090317691 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1200,6 +1200,9 @@ function rcmail_alter_html_link($matches)
$attrib = parse_attrib_string($matches[2]);
$end = '>';
+ // Remove non-printable characters in URL (#1487805)
+ $attrib['href'] = preg_replace('/[\x00-\x1F]/', '', $attrib['href']);
+
if ($tag == 'link' && preg_match('/^https?:\/\//i', $attrib['href'])) {
$tempurl = 'tmp-' . md5($attrib['href']) . '.css';
$_SESSION['modcssurls'][$tempurl] = $attrib['href'];