From 8d562abe784dc9f555372c35799f5e5dfd18dc99 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 8 Jan 2014 00:03:01 -0800 Subject: keep the to-do list somewhat current. --- mod/filestorage.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mod/filestorage.php') diff --git a/mod/filestorage.php b/mod/filestorage.php index 0d92c0d2a..43ea17789 100644 --- a/mod/filestorage.php +++ b/mod/filestorage.php @@ -78,10 +78,17 @@ function filestorage_content(&$a) { } $file = intval(argv(2)); - $r = q("delete from attach where id = %d and uid = %d limit 1", + $r = q("select hash from attach where id = %d and uid = %d limit 1", dbesc($file), intval($owner) ); + if(! $r) { + notice( t('File not found.') . EOL); + goaway(z_root() . '/filestorage' . $which); + } + + attach_delete($owner,$r[0]['hash']); + goaway(z_root() . '/filestorage' . $which); } -- cgit v1.2.3