diff options
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/rcube_imap_generic.php | 6 | ||||
-rw-r--r-- | program/include/rcube_shared.inc | 6 | ||||
-rw-r--r-- | program/include/rcube_string_replacer.php | 3 |
3 files changed, 8 insertions, 7 deletions
diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php index 36638d25d..85c21f414 100644 --- a/program/include/rcube_imap_generic.php +++ b/program/include/rcube_imap_generic.php @@ -1207,8 +1207,8 @@ class rcube_imap_generic { if (is_array($items) && !empty($items)) { foreach ($items as $key => $value) { - $args[] = $this->escape($key); - $args[] = $this->escape($value); + $args[] = $this->escape($key, true); + $args[] = $this->escape($value, true); } } @@ -1219,7 +1219,7 @@ class rcube_imap_generic if ($code == self::ERROR_OK && preg_match('/\* ID /i', $response)) { $response = substr($response, 5); // remove prefix "* ID " - $items = $this->tokenizeResponse($response); + $items = $this->tokenizeResponse($response, 1); $result = null; for ($i=0, $len=count($items); $i<$len; $i += 2) { diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc index afaa15d69..f1edcbf93 100644 --- a/program/include/rcube_shared.inc +++ b/program/include/rcube_shared.inc @@ -232,7 +232,7 @@ function make_absolute_url($path, $base_url) } // $path is absolute - if ($path{0}=='/') + if ($path[0] == '/') $abs_path = $host_url.$path; else { @@ -244,13 +244,13 @@ function make_absolute_url($path, $base_url) { if (strrpos($base_url, '/')) $base_url = substr($base_url, 0, strrpos($base_url, '/')); - + $path = substr($path, 3); } $abs_path = $base_url.'/'.$path; } - + return $abs_path; } diff --git a/program/include/rcube_string_replacer.php b/program/include/rcube_string_replacer.php index 8fcbecaba..ec40156d2 100644 --- a/program/include/rcube_string_replacer.php +++ b/program/include/rcube_string_replacer.php @@ -36,7 +36,8 @@ class rcube_string_replacer function __construct() { // Simplified domain expression for UTF8 characters handling - $utf_domain = '[^?&@"\'\\/()\s\r\t\n]+\\.[a-z]{2,5}'; + // Support unicode/punycode in top-level domain part + $utf_domain = '[^?&@"\'\\/()\s\r\t\n]+\\.([^\\x00-\\x40\\x5b-\\x60\\x7b-\\x7f]{2,}|xn--[a-z0-9]{2,})'; $url1 = '.:;'; $url2 = 'a-z0-9%=#@+?&\\/_~\\[\\]-'; |