aboutsummaryrefslogtreecommitdiffstats
path: root/mod/filestorage.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-08 00:03:01 -0800
committerfriendica <info@friendica.com>2014-01-08 00:03:01 -0800
commit8d562abe784dc9f555372c35799f5e5dfd18dc99 (patch)
treea4c69db90b106df8fa7539f87592b1779e7a87e5 /mod/filestorage.php
parent8b93881ce7ab4e0a8b0c8426da1ddfeed19c2309 (diff)
downloadvolse-hubzilla-8d562abe784dc9f555372c35799f5e5dfd18dc99.tar.gz
volse-hubzilla-8d562abe784dc9f555372c35799f5e5dfd18dc99.tar.bz2
volse-hubzilla-8d562abe784dc9f555372c35799f5e5dfd18dc99.zip
keep the to-do list somewhat current.
Diffstat (limited to 'mod/filestorage.php')
-rw-r--r--mod/filestorage.php9
1 files changed, 8 insertions, 1 deletions
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);
}