From dafbf32c4b41a17f54d19b5878d4db7914cd1248 Mon Sep 17 00:00:00 2001 From: zone Date: Thu, 14 Jun 2001 06:39:10 +0000 Subject: [PATCH] Prevent moving directories into themselves --- phpgwapi/inc/class.vfs_wip.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/phpgwapi/inc/class.vfs_wip.inc.php b/phpgwapi/inc/class.vfs_wip.inc.php index 2ac39a7ec4..cce869fcf0 100644 --- a/phpgwapi/inc/class.vfs_wip.inc.php +++ b/phpgwapi/inc/class.vfs_wip.inc.php @@ -674,6 +674,15 @@ class vfs umask (000); + /* We can't move directories into themselves */ + if (($this->file_type ($f->fake_full_path, array (RELATIVE_NONE)) == "Directory") && ereg ("^$f->fake_full_path", $t->fake_full_path)) + { + if (($t->fake_full_path == $f->fake_full_path) || substr ($t->fake_full_path, strlen ($f->fake_full_path), 1) == "/") + { + return False; + } + } + if ($this->file_exists ($f->fake_full_path, array (RELATIVE_NONE))) { /* We get the listing now, because it will change after we update the database */