aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSystem user; apache <apache@saturn.midworld.de>2023-09-15 15:28:13 +0200
committerSystem user; apache <apache@saturn.midworld.de>2023-09-15 15:28:13 +0200
commit3a01aa40d8f788c89f50f9893214f6591dac7bae (patch)
tree29d44766e9d859e28bb329eb41f7114f7ca0f3c6
parentec66949b35b731bcf887ea5c4f8278b273ae64f8 (diff)
downloadvolse-hubzilla-3a01aa40d8f788c89f50f9893214f6591dac7bae.tar.gz
volse-hubzilla-3a01aa40d8f788c89f50f9893214f6591dac7bae.tar.bz2
volse-hubzilla-3a01aa40d8f788c89f50f9893214f6591dac7bae.zip
only select the required fields to prevent memory exhaustion on big result sets
-rw-r--r--include/items.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/items.php b/include/items.php
index d88a676a1..57e5dbb96 100644
--- a/include/items.php
+++ b/include/items.php
@@ -3920,16 +3920,19 @@ function drop_item($id,$interactive = true,$stage = DROPITEM_NORMAL) {
$notify_id = intval($item['id']);
- $items = q("select * from item where parent = %d and uid = %d",
+ $items = q("select id, resource_id, uid, resource_type, mid from item where parent = %d and uid = %d",
intval($item['id']),
intval($item['uid'])
);
+
if($items) {
- foreach($items as $i)
+ foreach($items as $i) {
delete_item_lowlevel($i, $stage);
+ }
}
- else
+ else {
delete_item_lowlevel($item, $stage);
+ }
if(! $interactive)
return 1;