Really fix #2997
diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php
index 5a856f1..587b6c2 100644
--- a/system/libraries/Ftp.php
+++ b/system/libraries/Ftp.php
@@ -477,7 +477,7 @@
 			{
 				// If we can't delete the item it's probaly a directory,
 				// so we'll recursively call delete_dir()
-				if ( ! in_array($list[$i], array('.', '..'), TRUE) && ! @ftp_delete($this->conn_id, $list[$i]))
+				if ( ! preg_match('#/\.\.?$#', $list[$i]) && ! @ftp_delete($this->conn_id, $list[$i]))
 				{
 					$this->delete_dir($list[$i]);
 				}