cvs: pear /Net_FTP/Net FTP.php
| From: | Tobias Schlitt | Date: | Thu, 09 Feb 2006 22:52:39 +0000 |
| Subject: | cvs: pear /Net_FTP/Net FTP.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-38096@lists.php.net to get a copy of this message | ||
toby Thu Feb 9 22:52:39 2006 UTC
Modified files:
/pear/Net_FTP/Net FTP.php
Log:
* Fixed Bug #4969: Recursive rm ends in endless loop.
* Fixed Bug #5895: Recursive chmod ends in endless loop.
http://cvs.php.net/viewcvs.cgi/pear/Net_FTP/Net/FTP.php?r1=1.42&r2=1.43&diff_format=u
Index: pear/Net_FTP/Net/FTP.php
diff -u pear/Net_FTP/Net/FTP.php:1.42 pear/Net_FTP/Net/FTP.php:1.43
--- pear/Net_FTP/Net/FTP.php:1.42 Thu Mar 31 20:07:58 2005
+++ pear/Net_FTP/Net/FTP.php Thu Feb 9 22:52:39 2006
@@ -19,7 +19,7 @@
* @author Tobias Schlitt <toby@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: FTP.php,v 1.42 2005/03/31 20:07:58 toby Exp $
+ * @version CVS: $Id: FTP.php,v 1.43 2006/02/09 22:52:39 toby Exp $
* @link http://pear.php.net/package/Net_FTP
* @since File available since Release 0.0.1
*/
@@ -570,8 +570,16 @@
var $_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+(.+)/',
- 'map' =>
array('name'=>8,'size'=>6,'rights'=>2,'user'=>4,'group'=>5,
-
'files_inside'=>3,'date'=>7,'is_dir'=>1)
+ 'map' => array(
+ 'is_dir' => 1,
+ 'rights' => 2,
+ 'files_inside' => 3,
+ 'user' => 4,
+ 'group' => 5,
+ 'size' => 6,
+ 'date' => 7,
+ 'name' => 8,
+ )
),
'windows' => array(
'pattern' => '/(.+)\s+(.+)\s+((<DIR>)|[0-9]+)\s+(.+)/',
@@ -927,7 +935,10 @@
$mode = NET_FTP_DIRS_ONLY;
$dir_list = $this->ls($remote_path, $mode);
foreach ($dir_list as $dir_entry) {
-
+ if ($dir_entry == '.' || $dir_entry == '..') {;
+ continue;
+ }
+
$remote_path_new = $remote_path.$dir_entry["name"]."/";
// Chmod the directory we're about to enter
@@ -1896,6 +1907,9 @@
}
$dir_list = $this->_ls_dirs($dir);
foreach ($dir_list as $new_dir) {
+ if ($new_dir == '.' || $new_dir == '..') {
+ continue;
+ }
$new_dir = $dir.$new_dir["name"]."/";
$res = $this->_rm_dir_recursive($new_dir);
if ($this->isError($res)) {