alecpl
2011-02-28 29c54229cfbc104930e7743cecc212f53aed8a15
- Fix parsing links with non-printable characters inside (#1487805)


3 files modified
10 ■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/lib/html2text.php 6 ●●●●● patch | view | raw | blame | history
program/steps/mail/func.inc 3 ●●●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Fix parsing links with non-printable characters inside (#1487805)
- Force IE to send referers (#1487806)
- Fixed de_CH Localization bugs (#1487773)
- Better display of vcard import results (#1485457)
program/lib/html2text.php
@@ -652,10 +652,12 @@
        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
     *
program/steps/mail/func.inc
@@ -1200,6 +1200,9 @@
  $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'];