note 43426 deleted from ref.mail by kennyt
| From: | kennyt@php.net | Date: | Sun, 18 Jul 2004 17:34:35 +0000 |
| Subject: | note 43426 deleted from ref.mail by kennyt | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-73523@lists.php.net to get a copy of this message | ||
Note Submitter:
----
About the qp_encoding function below from f dot touchard at laposte dot net (good function though,
thanks), 2 points:
1. A problem may appear if the string is truncated just before a "." (dot). The dot would
disappear after decoding => this can cause problems for instance if the dot was part of a URL,
the URL would not work on the email.
I have inserted the following lines to solve this problem:
(...)
if (preg_match("/^=(3D|([8-9A-F]{1}[0-9A-F]{1}))$/", substr($Line,
($Pointer+74), 3))) $Offset=-1;
// decrease line length until char is different from dot
$dot_seek=0;
while (substr($Line,$Pointer+75-$dot_seek,1)=="."){$dot_seek++;};
$Offset=$Offset-$dot_seek;
$Message_qp.= substr($Line, $Pointer, (75+$Offset))."=\n";
(...)
2. The function worked better for me replacing the "\n" by "\r\n" everywhere.
That's all folks, thanks for the notes you post, they are often more helpful than the original
guidelines!