diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-06-30 09:54:32 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-06-30 09:54:32 +0000 |
| commit | fbaf5fbf954b37e5522bc69092a969c7421cdc15 (patch) | |
| tree | 7f7db8d2dc2c82ecc75f566969bb37e400b879ad | |
| parent | 323a1266ccc810c880dbd800fbf009e6c8598673 (diff) | |
- fixed utf7_to_utf8() for numeric input (#1485175)
git-svn-id: https://svn.roundcube.net/trunk@1581 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/lib/utf7.inc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/roundcubemail/program/lib/utf7.inc b/roundcubemail/program/lib/utf7.inc index 9ea5f6db5..d2068be79 100644 --- a/roundcubemail/program/lib/utf7.inc +++ b/roundcubemail/program/lib/utf7.inc @@ -39,16 +39,17 @@ function utf7_to_utf8($str) ); $u7len = strlen($str); + $str = strval($str); $p = $err = ''; for ($i=0; $u7len > 0; $i++, $u7len--) { - $u7 = $str{$i}; + $u7 = $str[$i]; if ($u7 == '&') { $i++; $u7len--; - $u7 = $str{$i}; + $u7 = $str[$i]; if ($u7len && $u7 == '-') { @@ -60,7 +61,7 @@ function utf7_to_utf8($str) $k = 10; for (; $u7len > 0; $i++, $u7len--) { - $u7 = $str{$i}; + $u7 = $str[$i]; if ((ord($u7) & 0x80) || ($b = $Index_64[ord($u7)]) == -1) break; @@ -106,7 +107,7 @@ function utf7_to_utf8($str) return $err; /* Adjacent BASE64 sections */ - if ($u7len > 2 && $str{$i+1} == '&' && $str{$i+2} != '-') + if ($u7len > 2 && $str[$i+1] == '&' && $str[$i+2] != '-') return $err; } /* Not printable US-ASCII */ @@ -141,7 +142,7 @@ function utf8_to_utf7($str) while ($u8len) { - $u8 = $str{$i}; + $u8 = $str[$i]; $c = ord($u8); if ($c < 0x80) @@ -187,7 +188,7 @@ function utf8_to_utf7($str) for ($j=0; $j < $n; $j++) { - $o = ord($str{$i+$j}); + $o = ord($str[$i+$j]); if (($o & 0xc0) != 0x80) return $err; $ch = ($ch << 6) | ($o & 0x3f); |
