ID: 3110
Updated by: [EMAIL PROTECTED]
Reported By: bfranklin at dct dot com
-Status: Open
+Status: Wont Fix
Bug Type: Misbehaving function
Operating System: Solaris 2.7
PHP Version: 3.0.13
New Comment:
We are sorry, but we can not support PHP 3 related problems anymore.
Momentum is gathering for PHP 5, and we think supporting PHP 3 will
lead to a waste of resources which we want to put into getting PHP 5
ready. Of course PHP 4 will continue to be supported for the
forseeable future.
Previous Comments:
------------------------------------------------------------------------
[2000-01-05 15:56:16] bfranklin at dct dot com
quoted_printable_decode still doesn't handle 'soft' line breaks or
padding correctly. If you want to see it fail, try running it on the
encoded string given in RFC-1521 section 5.1 rule #5. To save you the
trouble this is what code to do that would look like.
<?
# the extra spaces and tabs after the '='s where added by
# me to demonstrate that they aren't handled properly either
# see rule 3 in the same section of the RFC
$string = "Now's the time = \r\n";
$string .= "for all folk to come=\t \t \r\n";
$string .= " to the aid of their country.";
echo quoted_printable_decode($string);
?>
The = characters in the out put are not supposed to be there.
To save you some time, here is the patch I use to fix this problem.
It's a patch against 3.0.11. But this function hasn't changed much (if
at all) since then.
--- php-3.0.11/functions/quot_print.c.orig Wed Jun 16 06:34:22 1999
+++ php-3.0.11/functions/quot_print.c Wed Jul 28 12:03:19 1999
@@ -94,11 +94,21 @@
+ _php3_hex2int((int)str[i+2]);
i += 3;
}
- else if ( str[i] == 13 )
- {
- i++;
- }
- else
+ else if ( str[i] == '=' )
+ {
+ if( str[i+1] == 10 || str[i+1] == 13 )
+ i+=2;
+ else if( str[i+1] == 13 && str[i+2] == 10 )
+ i+=3;
+ }
+ else if ( (str[i] == 9 || str[i] == 32) && str[i+1] == 13 )
+ {
+ while ( str[j] == 9 || str[j] == 32 )
+ j--;
+ j++;
+ str[j++] = str[i++];
+ }
+ else
{
str[j++] = str[i++];
}
I've also checked 4.0b3 and the bug exists there as well.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=3110&edit=1