From: Michael J. Rubinsky Date: Sat, 24 Oct 2009 18:51:30 +0000 (-0400) Subject: MFB: Catch errors from incorrectly configured VFS. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d3bb9ce6edca29da714c945b361e75597388926d;p=horde.git MFB: Catch errors from incorrectly configured VFS. Bug: 7741 --- diff --git a/turba/lib/Object.php b/turba/lib/Object.php index 06f9d772e..1ae8b2bbe 100644 --- a/turba/lib/Object.php +++ b/turba/lib/Object.php @@ -272,9 +272,11 @@ class Turba_Object { */ function deleteFile($file) { - $this->_vfsInit(); - - return $this->_vfs->deleteFile(TURBA_VFS_PATH . '/' . $this->getValue('__uid'), $file); + if (!is_a($result = $this->_vfsInit(), 'PEAR_Error')) { + return $this->_vfs->deleteFile(TURBA_VFS_PATH . '/' . $this->getValue('__uid'), $file); + } else { + return $result; + } } /** @@ -282,13 +284,15 @@ class Turba_Object { */ function deleteFiles() { - $this->_vfsInit(); + if (!is_a($result = $this->_vfsInit(), 'PEAR_Error')) { + if ($this->_vfs->exists(TURBA_VFS_PATH, $this->getValue('__uid'))) { + return $this->_vfs->deleteFolder(TURBA_VFS_PATH, $this->getValue('__uid'), true); + } - if ($this->_vfs->exists(TURBA_VFS_PATH, $this->getValue('__uid'))) { - return $this->_vfs->deleteFolder(TURBA_VFS_PATH, $this->getValue('__uid'), true); + return true; } - return true; + return $result; } /**