diff --git a/lib/public/share.php b/lib/public/share.php
index d736871d2440004d99fac20eaa75c3a3f2be9d90..7d8bfe6a5ed259ba4da93f65459504eff4afcf40 100644
--- a/lib/public/share.php
+++ b/lib/public/share.php
@@ -569,7 +569,7 @@ class Share {
 					$itemTypes = $collectionTypes;
 				}
 				$placeholders = join(',', array_fill(0, count($itemTypes), '?'));
-				$where .= ' WHERE `item_type` IN ('.$placeholders.'))';
+				$where = ' WHERE `item_type` IN ('.$placeholders.'))';
 				$queryArgs = $itemTypes;
 			} else {
 				$where = ' WHERE `item_type` = ?';