Home » PHP » PHP_Compat » Bug #8338
convert_uudecode removes spaces from line ends, causing corruption
Details
| Submitted | 2006-08-01 14:21 UTC |
|---|---|
| From | markhewitt at file56 dot com |
| Assigned | aidan |
| Status | Closed |
| Package | PHP_Compat |
| PHP Version | 4.4.2 |
| OS | Windows XP/FreeBSD 4.x |
| Roadmaps | 1.6.0a1 |
Comments
[2006-08-01 14:21 UTC] markhewitt at file56 dot com
Description:
------------
I have used covert_uudecode module now to decrypt some PDF content.
I found that the result is always corrupted, and the problem would appear to be in line 52,
$c = count($bytes = unpack('c*', substr(trim($line), 1)));
The trim(...) operation is removing not only trailing line breaks but also any spaces that may be part of the legitimate content. Modifying line 52 to read:
$c = count($bytes = unpack('c*', substr(trim($line,"\r\n\t"), 1)));
would seem to correct this problem.