diff options
author | Thomas Abthorpe <tabthorpe@FreeBSD.org> | 2009-11-10 04:10:37 +0000 |
---|---|---|
committer | Thomas Abthorpe <tabthorpe@FreeBSD.org> | 2009-11-10 04:10:37 +0000 |
commit | 8590dd2b0c24c00257d3ca998eab4c3610720336 (patch) | |
tree | a1b6084dc148f87a875b83ab9b5742f0ff317cb7 /mail/squirrelmail | |
parent | 8994d1fa6eed4fcc57562a4dd84785531111a83a (diff) | |
download | ports-8590dd2b0c24c00257d3ca998eab4c3610720336.tar.gz ports-8590dd2b0c24c00257d3ca998eab4c3610720336.zip |
- Fix imap search [1]
- Really fix Japanese text corruption [2]
- Bump PORTREVISION
Submitted by: Carlos Fernando Assis Paniago via Simon Dick [1]
Submitted by: Kazuo Dohzono [2]
Obtained from: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550763 [1]
Notes
Notes:
svn path=/head/; revision=244052
Diffstat (limited to 'mail/squirrelmail')
-rw-r--r-- | mail/squirrelmail/Makefile | 3 | ||||
-rw-r--r-- | mail/squirrelmail/files/patch-functions__i18n.php | 20 | ||||
-rw-r--r-- | mail/squirrelmail/files/patch-functions__imap_search.php | 68 |
3 files changed, 80 insertions, 11 deletions
diff --git a/mail/squirrelmail/Makefile b/mail/squirrelmail/Makefile index b0994ae12d99..cb1864457b1e 100644 --- a/mail/squirrelmail/Makefile +++ b/mail/squirrelmail/Makefile @@ -7,7 +7,7 @@ PORTNAME= squirrelmail PORTVERSION= 1.4.20.r2 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= mail www MASTER_SITES= SF/${PORTNAME}/stable/${PORTVERSION:S/.r/-RC/}:squirrelmail \ SF/${PORTNAME}/locales/1.4.18-20090526:locales @@ -64,6 +64,7 @@ post-patch: ${WRKSRC}/config/config_default.php.orig \ ${WRKSRC}/functions/global.php.orig \ ${WRKSRC}/functions/i18n.php.orig \ + ${WRKSRC}/functions/imap_search.php.orig \ ${WRKSRC}/src/addrbook_search_html.php.orig \ ${WRKSRC}/src/compose.php.orig .endif diff --git a/mail/squirrelmail/files/patch-functions__i18n.php b/mail/squirrelmail/files/patch-functions__i18n.php index 30b98d0d4537..56f788f47a69 100644 --- a/mail/squirrelmail/files/patch-functions__i18n.php +++ b/mail/squirrelmail/files/patch-functions__i18n.php @@ -1,14 +1,14 @@ --- ./functions/i18n.php.orig 2009-07-28 22:21:06.000000000 -0400 -+++ ./functions/i18n.php 2009-10-08 10:30:25.000000000 -0400 -@@ -146,7 +146,7 @@ - } - - /* safety checks */ -- if (preg_match("/^.*\/.*\/.*\/.*\/.*\/.*$/",$ret)) { -+ if (preg_match("/^.*\/.*\/.*\/.*\/.*\/.*$/i",$ret)) { - /** - * Welcome to We-Don't-Follow-Own-Fine-Manual department - * OpenBSD 3.8, 3.9-current and maybe later versions ++++ ./functions/i18n.php 2009-11-09 11:22:46.000000000 -0500 +@@ -675,7 +675,7 @@ + break; + case 'decodeheader': + $ret = str_replace("\t", "", $ret); +- if (preg_match('/=\?([^?]+)\?(q|b)\?([^?]+)\?=/', $ret)) ++ if (preg_match('/=\?([^?]+)\?(q|b)\?([^?]+)\?=/i', $ret)) + $ret = @mb_decode_mimeheader($ret); + $ret = @mb_convert_encoding($ret, 'EUC-JP', 'AUTO'); + break; @@ -683,7 +683,8 @@ $useragent = func_get_arg(2); if (strstr($useragent, 'Windows') !== false || diff --git a/mail/squirrelmail/files/patch-functions__imap_search.php b/mail/squirrelmail/files/patch-functions__imap_search.php new file mode 100644 index 000000000000..1f1ca53b053d --- /dev/null +++ b/mail/squirrelmail/files/patch-functions__imap_search.php @@ -0,0 +1,68 @@ +--- ./functions/imap_search.php.orig 2009-11-09 11:29:39.000000000 -0500 ++++ ./functions/imap_search.php 2009-11-09 11:38:35.000000000 -0500 +@@ -46,22 +46,23 @@ + on the client side, but should be fixed on the server + as per the RFC */ + +- if ($imap_server_type == 'macosx' || $imap_server_type == 'hmailserver') { +- foreach ($multi_search as $multi_search_part) { +- if (strtoupper($languages[$squirrelmail_language]['CHARSET']) == 'ISO-2022-JP') { +- $multi_search_part = mb_convert_encoding($multi_search_part, 'JIS', 'auto'); +- } +- $search_string .= $search_where . ' ' .$multi_search_part . ' '; ++ if (strtoupper($languages[$squirrelmail_language]['CHARSET'] == 'ISO-2022-JP')) { ++ foreach($multi_search as $idx=>$search_part) { ++ $multi_search[$idx] = mb_convert_encoding($search_parth, 'JIS', 'auto'); + } + } ++ ++ $search_lit = array(); ++ ++ if ($imap_server_type == 'macosx' || $imap_server_type == 'hmailserver') { ++ $search_string .= $search_where . ' ' . implode(' ', $multi_search); ++ } + else { +- foreach ($multi_search as $multi_search_part) { +- if (strtoupper($languages[$squirrelmail_language]['CHARSET']) == 'ISO-2022-JP') { +- $multi_search_part = mb_convert_encoding($multi_search_part, 'JIS', 'auto'); +- } +- $search_string .= $search_where . ' {' . strlen($multi_search_part) +- . "}\r\n" . $multi_search_part . ' '; +- } ++ $search_string .= $search_where; ++ $search_lit = array( ++ 'command' => '', ++ 'literal_args' => $multi_search ++ ); + } + + $search_string = trim($search_string); +@@ -76,15 +77,24 @@ + $ss = "SEARCH ALL $search_string"; + } + +- /* read data back from IMAP */ +- $readin = sqimap_run_command($imapConnection, $ss, false, $result, $message, $uid_support); ++ if (empty($search_lit)) { ++ /* read data back from IMAP */ ++ $readin = sqimap_run_command($imapConnection, $ss, false, $result, $message, $uid_support); ++ } else { ++ $search_lit['command'] = $ss; ++ $readin = sqimap_run_literal_command($imapConnection, $search_lit, false, $result, $message, $uid_support); ++ } + + /* try US-ASCII charset if search fails */ + if (isset($languages[$squirrelmail_language]['CHARSET']) + && strtolower($result) == 'no') { + $ss = "SEARCH CHARSET \"US-ASCII\" ALL $search_string"; +- $readin = sqimap_run_command ($imapConnection, $ss, true, +- $result, $message, $uid_support); ++ if (empty($search_lit)) { ++ $readin = sqimap_run_command($imapConnection, $ss, false, $result, $message, $uid_support); ++ } else { ++ $search_lit['command'] = $ss; ++ $readin = sqimap_run_literal_command($imapConnection, $search_lit, false, $result, $message, $uid_support); ++ } + } + + unset($messagelist); |