Bug #72113 [Opn]: convert_uudecode() fails to decode data
| From: | jhdxr@php.net | Date: | Thu, 28 Apr 2016 13:52:56 +0000 |
| Subject: | Bug #72113 [Opn]: convert_uudecode() fails to decode data | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-200805@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72113&edit=1
ID: 72113
Updated by: jhdxr@php.net
Reported by: christian at rishoj dot net
Summary: convert_uudecode() fails to decode data
Status: Open
Type: Bug
Package: Strings related
Operating System: Linux and OS X
PHP Version: 7.0.5
Block user comment: N
Private report: N
New Comment:
https://3v4l.org/IJGeD
<?php
$encoded = 'M2$%4($-!3B=4($)%($)%050B.R(B.R)#1"!!3$)532([.#DN,#`[,3LR,#$V
:,#4R-SLB3B([,#LB3$]#04PB.R)01TTB#0I!';
echo convert_uudecode($encoded);
//HAT CAN'T BE BEAT";"";"CD
ALBUM";89.00;1;20160527;"N";0;"LOCAL";"PGM"
Previous Comments:
------------------------------------------------------------------------
[2016-04-27 21:48:58] christian at rishoj dot net
Description:
------------
PHP's convert_uudecode() fails to decode the following snippet of unencoded data:
begin 644 decoded.txt
M2$%4($-!3B=4($)%($)%050B.R(B.R)#1"!!3$)532([.#DN,#`[,3LR,#$V
:,#4R-SLB3B([,#LB3$]#04PB.R)01TTB#0I!
`
end
Both GNU's uudecode and Perl's uudecode successfully decode the data, but the
implementation in PHP simply produces an "r".
Test script:
---------------
<?php
$encoded = "begin 644 decoded.txt
M2$%4($-!3B=4($)%($)%050B.R(B.R)#1"!!3$)532([.#DN,#`[,3LR,#$V
:,#4R-SLB3B([,#LB3$]#04PB.R)01TTB#0I!
`
end";
echo convert_uudecode($encoded);
Expected result:
----------------
HAT CAN'T BE BEAT";"";"CD
ALBUM";89.00;1;20160527;"N";0;"LOCAL";"PGM"
Actual result:
--------------
r
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72113&edit=1