|  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
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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
6 + 5 = ?
Subscribe to this entry?

 [2016-04-27 21:48 UTC] christian at rishoj dot net
PHP's convert_uudecode() fails to decode the following snippet of unencoded data:

begin 644 decoded.txt

Both GNU's uudecode and Perl's uudecode successfully decode the data, but the implementation in PHP simply produces an "r".

Test script:

$encoded = "begin 644 decoded.txt

echo convert_uudecode($encoded);

Expected result:
HAT CAN'T BE BEAT";"";"CD ALBUM";89.00;1;20160527;"N";0;"LOCAL";"PGM"

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-28 13:52 UTC]


$encoded = 'M2$%4($-!3B=4($)%($)%050B.R(B.R)#1"!!3$)532([.#DN,#`[,3LR,#$V

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

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

$encoded = 'begin 644 test.txt

echo convert_uudecode($encoded);
// r
 [2018-05-05 11:43 UTC]
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem -Assigned To: +Assigned To: cmb
 [2018-05-05 11:43 UTC]
> 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]
Automatic comment from SVN on behalf of cmb
Log: Fix #72113: convert_uudecode() fails to decode data
 [2018-05-05 12:15 UTC]
-Status: Verified +Status: Closed
 [2018-05-05 12:15 UTC]
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]
Automatic comment on behalf of cmb
Log: Fix #72113: convert_uudecode() fails to decode data
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 18:01:29 2024 UTC