note 43426 added to ref.mail
| From: | php-general at lists dot php dot net | Date: | Mon, 21 Jun 2004 10:43:08 +0000 |
| Subject: | note 43426 added to ref.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-71430@lists.php.net to get a copy of this message | ||
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!
----
Manual Page -- http://www.php.net/manual/en/ref.mail.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+43426
Delete -- http://master.php.net/manage/user-notes.php?action=delete+43426&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+43426&report=yes
Search -- http://master.php.net/manage/user-notes.php