summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2013-03-29 14:54:08 +0100
committerThomas Tanghus <thomas@tanghus.net>2013-03-29 14:54:08 +0100
commita56abd3f9bdb1107bddb6cd8982a2be8727a938e (patch)
treec975b1d149767d3bd226932ebbfe42280d30b028
parentd838a3b33ff02ec5210695be593626f29dbc65a1 (diff)
downloadnextcloud-server-a56abd3f9bdb1107bddb6cd8982a2be8727a938e.tar.gz
nextcloud-server-a56abd3f9bdb1107bddb6cd8982a2be8727a938e.zip
Typehint and check $ids parameter.
-rw-r--r--lib/vcategories.php10
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;
}