Fixed bug with recursive deletes in delete_dir()
http://codeigniter.com/bug_tracker/bug/4215/
diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php
index 1b5ec2f..74b7728 100644
--- a/system/libraries/Ftp.php
+++ b/system/libraries/Ftp.php
@@ -379,15 +379,15 @@
$list = $this->list_files($filepath);
- if ($list !== FALSE AND count($list) > 0)
+ if ($list !== FALSE)
{
foreach ($list as $item)
{
// If we can't delete the item it's probaly a folder so
// we'll recursively call delete_dir()
- if (! @ftp_delete($this->conn_id, $filepath.$item))
+ if (! @ftp_delete($this->conn_id, $item))
{
- $this->delete_dir($filepath.$item);
+ $this->delete_dir($item);
}
}
}