Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.1

Bug #13689 . in file owner or group name breaks _ls_match
Submitted: 2008-04-15 20:33 UTC
From: mumura Assigned: jorrit
Status: Closed Package: Net_FTP (version 1.3.5)
PHP Version: 5.2.5 OS: Linux
Roadmaps: 1.3.6, 1.4.0a2    
Subscription  


 [2008-04-15 20:33 UTC] mumura (Mike Raistrick)
Description: ------------ My hosting providers' servers create file owner and group names to be the same as the domain of the hosting end user - e.g. 'mumura.com' - the period in the name isn't matched by the regular expression in: $this->_ls_match = array('unix' => array( 'pattern' => '/(?:(d)|.)([rwxt-]+)\s+(\w+)\s+([\w\d-()?]+)\s+' . '([\w\d-()?]+)\s+(\w+)\s+(\S+\s+\S+\s+\S+)\s+(.+)/' etc. Have attached a patch file which shows how I've been able to correct this but basically is each ([\w\d-()?]+) is changed to +([\w\d-()?\.]+). Apologies if the patch file isn't in the right format, but this is all still a little new to me. Test script: --------------- <?php set_include_path('/home/sites/mumura.com/pear/php' . PATH_SEPARATOR . get_include_path()); require_once 'Net/FTP.php'; $host = 'removed'; $port = 21; $user = 'removed'; $pass = 'removed'; $ftp = new Net_FTP(); $ftp->setHostname($host); $ftp->setPort($port); $ftp->connect(); $ftp->setUsername($user); $ftp->setPassword($pass); $ftp->login($user, $pass); echo '<p>ls(null, NET_FTP_DIRS_FILES)</p>', var_dump($ftp->ls(null, NET_FTP_DIRS_FILES)); echo '<p>ls(null, NET_FTP_RAWLIST)</p>', var_dump($ftp->ls(null, NET_FTP_RAWLIST)); $ftp->disconnect(); ?> Expected result: ---------------- For both ls entries arrays showing 15 files / directories Actual result: -------------- ls(null, NET_FTP_DIRS_FILES) array(1) { [0]=> array(9) { ["is_dir"]=> string(0) "" ["rights"]=> string(9) "rwxrwxrwx" ["files_inside"]=> string(1) "1" ["user"]=> string(4) "root" ["group"]=> string(4) "root" ["size"]=> string(2) "32" ["date"]=> string(12) "Mar 12 11:01" ["name"]=> string(40) "logs -> /var/log/virtual_logs/mumura.com" ["stamp"]=> int(1205319660) } } ls(null, NET_FTP_RAWLIST) array(15) { [0]=> string(58) "drwx--x--x 7 mumura.com 201538 4096 Apr 15 19:27 ." [1]=> string(59) "drwx--x--x 7 mumura.com 201538 4096 Apr 15 19:27 .." [2]=> string(70) "-rw------- 1 mumura.com 201538 1820 Apr 13 21:34 .bash_history" [3]=> string(69) "-rw-r--r-- 1 mumura.com 201538 24 Mar 12 10:32 .bash_logout" ...<SNIP>...

Comments

 [2008-04-22 20:42 UTC] jorrit (Jorrit Schippers)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.