diff options
-rw-r--r-- | lib/vcategories.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/vcategories.php b/lib/vcategories.php index a52c15f0670..372706b185a 100644 --- a/lib/vcategories.php +++ b/lib/vcategories.php @@ -541,9 +541,13 @@ class OC_VCategories { * Defaults to the type set in the instance * @returns boolean Returns false on error. */ - public function purgeObjects($ids, $type = null) { + public function purgeObjects(array $ids, $type = null) { $type = is_null($type) ? $this->type : $type; - $updates = array(); + if(count($ids) === 0) { + // job done ;) + return true; + } + $updates = $ids(); try { $query = 'DELETE FROM `' . self::RELATION_TABLE . '` '; $query .= 'WHERE `objid` IN (' . str_repeat('?,', count($ids)-1) . '?) '; @@ -557,7 +561,7 @@ class OC_VCategories { return false; } } catch(Exception $e) { - OCP\Util::writeLog('core', __METHOD__.', exception: '.$e->getMessage(), + OCP\Util::writeLog('core', __METHOD__.', exception: ' . $e->getMessage(), OCP\Util::ERROR); return false; } |