From:             [EMAIL PROTECTED]
Operating system: Linux 2.4.3
PHP version:      4.0.4pl1
PHP Bug Type:     *Mail Related
Bug description:  quoted_printable_decode() & imap_qprint() decodes control codes.

quoted_printable_decode() and imap_qprint() decodes control codes aswell. This, I 
assume, is not supposed to happen.

Also, these functions happily translate anything with two characters after the = sign 
(like =EV in =EVIL), which they shouldn't.

Example:

$foo="This is =00=01 =E4 \"=20\" =21 =ev =FE string.";
echo "Quoting string \"".$foo."\"\n";
echo "quoted_printable_decode: \"".quoted_printable_decode($foo)."\"\n";
echo "preg_replace:            \"".preg_replace("/\=([2-9A-Fa-f])([0-9A-Fa-f])/e", 
"''.chr(hexdec('\\1\\2')).''", $foo)."\"\n";

Would result in:
Quoting string "This is =00=01 =E4 =2B "=20" =21 =ev =FE string."
quoted_printable_decode: "This is   + " " !   string."
preg_replace:            "This is =00=01  + " " ! =ev  string."


Am I wrong in assuming that quoted_printable_decode() and imap_qprint() should act as 
my preg_replace line above does?



-- 
Edit Bug report at: http://bugs.php.net/?id=10489&edit=1



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to