aboutsummaryrefslogtreecommitdiffstats
path: root/include/attach.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-06 18:13:02 -0800
committerfriendica <info@friendica.com>2014-01-06 18:13:02 -0800
commit5a5466346cccecec257fc20a993bfa2426b8bf48 (patch)
treed0dc294fdf33ac1c733d5d0fbdc272052822d187 /include/attach.php
parent41df51a8151a5c1f35abe3c04f94e43b673e29ff (diff)
downloadvolse-hubzilla-5a5466346cccecec257fc20a993bfa2426b8bf48.tar.gz
volse-hubzilla-5a5466346cccecec257fc20a993bfa2426b8bf48.tar.bz2
volse-hubzilla-5a5466346cccecec257fc20a993bfa2426b8bf48.zip
prepare for OS file storage, and add bbcode attachment link to mod/filestorage. This isn't beautiful, but it's a start.
Diffstat (limited to 'include/attach.php')
-rw-r--r--include/attach.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/attach.php b/include/attach.php
index e602af984..b48dd211a 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -188,13 +188,13 @@ function attach_by_hash($hash,$rev = 0) {
$sql_extra = permissions_sql($r[0]['uid']);
// Now we'll see if we can access the attachment
-dbg(1);
+
$r = q("SELECT * FROM attach WHERE hash = '%s' and uid = %d $sql_extra LIMIT 1",
dbesc($hash),
intval($r[0]['uid'])
);
-dbg(0);
+
if(! $r) {
$ret['message'] = t('Permission denied.');
return $ret;
@@ -672,3 +672,9 @@ function attach_change_permissions($channel_id,$resource,$allow_cid,$allow_gid,$
}
+function pipe_streams($in, $out) {
+ $size = 0;
+ while (!feof($in))
+ $size += fwrite($out,fread($in,8192));
+ return $size;
+} \ No newline at end of file