| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2005-02-17 01:23 UTC] hoarau76 at free dot fr
 Description:
------------
I can't uudecode a string
it works under perl or winrar, but not with php 5.03
Reproduce code:
---------------
<?php
   $data = file_get_contents("http://www.chez.com/hoarau/bad_size.alt.binaries.picture.erotica.breasts.natural.87617");
   if (preg_match("/begin ([0-7]+) (.+)\r?\n(.+)\r?\nend/Us", $data, $part))
    {
    	$file = convert_uudecode($part[3]);
    }
 
?>
Expected result:
----------------
I expect this script to work but it doesn't and gave me:
PHP Warning:  convert_uudecode(): The given parameter is not a valid uuencoded s
tring. in C:\a.php on line 7
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 05:00:01 2025 UTC | 
Your regular expression is obviously wrong, as it cuts '\n' at the end. Change your code to 'preg_match("/begin ([0-7]+) (.+)\r?\n(.+)\r?end/Us", $data, $part)' and see that convert_uudecode() work fine.