[Hastymail-cvs] hastymail/lib general.php,1.267,1.268
Brought to you by:
sailfrog,
slushpupie
From: <sai...@us...> - 2005-11-21 18:25:30
|
Update of /cvsroot/hastymail/hastymail/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv779 Modified Files: general.php Log Message: fix for space vs underscore in quoted printable decoding. Index: general.php =================================================================== RCS file: /cvsroot/hastymail/hastymail/lib/general.php,v retrieving revision 1.267 retrieving revision 1.268 diff -u -d -r1.267 -r1.268 --- general.php 2 Nov 2005 17:19:03 -0000 1.267 +++ general.php 21 Nov 2005 18:25:21 -0000 1.268 @@ -531,7 +531,7 @@ $chunk = base64_decode($encoded_text); } elseif (strtolower($encoding) == 'q') { - $chunk = &hm_quoted_decode($encoded_text); + $chunk = &hm_quoted_decode($encoded_text, true); } else { $chunk = $encoded_text; @@ -784,11 +784,14 @@ * decode quoted printable values * * @param $string string string to decode + * @param $header boolean true if string is a special header value * @return string decoded text * */ -function &hm_quoted_decode($string) { - $string = str_replace('_', '=20', $string); +function &hm_quoted_decode($string, $header=false) { + if ($header) { + $string = str_replace('_', '=20', $string); + } $string = preg_replace("/(\=[0-9A-Za-z]{2})\n/", "\\1 \n", $string); $result = preg_replace("/\=([0-9A-Za-z]{2})/e", "''.chr(hexdec('\\1')).''", $string); |