Doc #72113 [Ver->Csd]: convert_uudecode() fails to decode data
| From: | cmb@php.net | Date: | Sat, 05 May 2018 12:15:33 +0000 |
| Subject: | Doc #72113 [Ver->Csd]: convert_uudecode() fails to decode data | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-15649@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: cmb@php.net
Reported by: christian at rishoj dot net
Summary: convert_uudecode() fails to decode data
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: Strings related
Operating System: Linux and OS X
PHP Version: 7.0.5
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2018-05-05 12:14:32] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=344961
Log: Fix #72113: convert_uudecode() fails to decode data
------------------------------------------------------------------------
[2018-05-05 11:43:45] 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.
------------------------------------------------------------------------
[2016-04-28 14:27:44] 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
------------------------------------------------------------------------
[2016-04-28 13:52:53] 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-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