php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72113 convert_uudecode() fails to decode data
Submitted: 2016-04-27 21:48 UTC Modified: 2018-05-05 12:15 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: christian at rishoj dot net Assigned: cmb (profile)
Status: Closed Package: Strings related
PHP Version: 7.0.5 OS: Linux and OS X
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: christian at rishoj dot net
New email:
PHP Version: OS:

 

 [2016-04-27 21:48 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-28 13:52 UTC] jhdxr@php.net
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"
 [2016-04-28 14:27 UTC] christian at rishoj dot net
It seems to be Uuencoding header that trips the function up.

This decodes properly:

$encoded = '&<&QA:6X*';

echo convert_uudecode($encoded);
// plain

https://3v4l.org/XKKPX


With the header, it just produces an "r";

$encoded = 'begin 644 test.txt
&<&QA:6X*
`
end';

echo convert_uudecode($encoded);
// r

https://3v4l.org/PWMIQ
 [2018-05-05 11:43 UTC] cmb@php.net
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem -Assigned To: +Assigned To: cmb
 [2018-05-05 11:43 UTC] cmb@php.net
> It seems to be Uuencoding header that trips the function up.

That!  convert_uuencode() doesn't produce the file header/footer,
and as such convert_uudecode() doesn't expect these.  Actually,
both functions only handle a single data line.  The rest is up to
the developer.
 [2018-05-05 12:14 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=344961
Log: Fix #72113: convert_uudecode() fails to decode data
 [2018-05-05 12:15 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2018-05-05 12:15 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-02-07 06:05 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=4925366b0eac07552fc41503975e720cb4a43f05
Log: Fix #72113: convert_uudecode() fails to decode data
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC