Ticket #1485083 (closed Bugs: fixed)
rcube_charset_convert() does not verify whether iconv() worked
| Reported by: | dog | Owned by: | till |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.2-beta |
| Component: | PHP backend | Version: | 0.1.1 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
In rcube_charset_convert() there is the following code:
// convert charset using iconv module
if (function_exists('iconv') && $from != 'UTF-7' && $to != 'UTF-7')
{
$aliases['GB2312'] = 'GB18030';
return iconv(($aliases[$from] ? $aliases[$from] : $from), ($aliases[$to] ? $aliases[$to] : $to) . "//IGNORE", $str);
}
This does not verify that iconv() acutally worked. For me this resulted in getting "IMAP Error: Invalid login" errors in a shared hosting environment.
Writing the line as
$iconvRes = iconv(($aliases[$from] ? $aliases[$from] : $from), ($aliases[$to] ? $aliases[$to] : $to) . "//IGNORE", $str); if($iconvRes !== FALSE) return $iconvRes;
fixed my problem.
Change History
Note: See
TracTickets for help on using
tickets.
