Bug #72113 [Opn]: convert_uudecode() fails to decode data

From: Date: Thu, 28 Apr 2016 14:27:48 +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-200808@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 User updated by: christian at rishoj dot 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: 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 Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#200808) next »