aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/include/functions.php')
-rw-r--r--admin/include/functions.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index ea62a0bbb..16e21d827 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -1602,7 +1602,16 @@ DELETE '.IMAGE_CATEGORY_TABLE.'.*
FROM '.IMAGE_CATEGORY_TABLE.'
JOIN '.IMAGES_TABLE.' ON image_id=id
WHERE id IN ('.implode(',', $images).')
- '.((is_array($categories) and count($categories)>0) ? 'AND category_id NOT IN ('.implode(',', $categories).')' : null).'
+';
+
+ if (is_array($categories) and count($categories) > 0)
+ {
+ $query.= '
+ AND category_id NOT IN ('.implode(',', $categories).')
+';
+ }
+
+ $query.= '
AND (storage_category_id IS NULL OR storage_category_id != category_id)
;';
pwg_query($query);