aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <mike@macgirvin.com>2016-09-28 16:51:47 -0700
committerredmatrix <mike@macgirvin.com>2016-09-28 16:51:47 -0700
commit095e2bf0b39fdf18217b15f5f743e32e2a49d587 (patch)
treef58ff512f89d92e0013c0ac0f228eca10bd23d6b
parentffee413d2d9bb153dad4efd6b79e6568a73c0bd6 (diff)
downloadvolse-hubzilla-095e2bf0b39fdf18217b15f5f743e32e2a49d587.tar.gz
volse-hubzilla-095e2bf0b39fdf18217b15f5f743e32e2a49d587.tar.bz2
volse-hubzilla-095e2bf0b39fdf18217b15f5f743e32e2a49d587.zip
file clone sync issue, 1. channel permission import had no uid, 2. mod_getfile was sending attach['data'] instead of attach['content']
-rw-r--r--Zotlabs/Module/Getfile.php27
-rw-r--r--include/zot.php5
2 files changed, 18 insertions, 14 deletions
diff --git a/Zotlabs/Module/Getfile.php b/Zotlabs/Module/Getfile.php
index 09d761887..986a819ea 100644
--- a/Zotlabs/Module/Getfile.php
+++ b/Zotlabs/Module/Getfile.php
@@ -27,6 +27,8 @@ require_once('include/attach.php');
class Getfile extends \Zotlabs\Web\Controller {
function post() {
+
+ logger('post: ' . print_r($_POST,true),LOGGER_DEBUG,LOG_INFO);
$hash = $_POST['hash'];
$time = $_POST['time'];
@@ -38,9 +40,11 @@ class Getfile extends \Zotlabs\Web\Controller {
killme();
$channel = channelx_by_hash($hash);
-
- if((! $channel) || (! $time) || (! $sig))
+
+ if((! $channel) || (! $time) || (! $sig)) {
+ logger('error: missing info');
killme();
+ }
$slop = intval(get_pconfig($channel['channel_id'],'system','getfile_time_slop'));
if($slop < 1)
@@ -58,16 +62,15 @@ class Getfile extends \Zotlabs\Web\Controller {
logger('verify failed.');
killme();
}
-
-
+
$r = attach_by_hash($resource,$revision);
if(! $r['success']) {
+ logger('attach_by_hash failed: ' . $r['message']);
notice( $r['message'] . EOL);
return;
}
-
-
+
$unsafe_types = array('text/html','text/css','application/javascript');
if(in_array($r['data']['filetype'],$unsafe_types)) {
@@ -76,10 +79,10 @@ class Getfile extends \Zotlabs\Web\Controller {
else {
header('Content-type: ' . $r['data']['filetype']);
}
-
+
header('Content-disposition: attachment; filename="' . $r['data']['filename'] . '"');
if(intval($r['data']['os_storage'])) {
- $fname = dbunescbin($r['data']['data']);
+ $fname = dbunescbin($r['data']['content']);
if(strpos($fname,'store') !== false)
$istream = fopen($fname,'rb');
else
@@ -91,11 +94,9 @@ class Getfile extends \Zotlabs\Web\Controller {
fclose($ostream);
}
}
- else
- echo dbunescbin($r['data']['data']);
+ else {
+ echo dbunescbin($r['data']['content']);
+ }
killme();
-
-
-
}
}
diff --git a/include/zot.php b/include/zot.php
index e0a86abc0..f5b7a383e 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -3164,7 +3164,10 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
if(array_key_exists('channel',$arr) && is_array($arr['channel']) && count($arr['channel'])) {
- translate_channel_perms_inbound($arr['channel']);
+ $remote_channel = $arr['channel'];
+ $remote_channel['channel_id'] = $channel['channel_id'];
+ translate_channel_perms_inbound($remote_channel);
+
if(array_key_exists('channel_pageflags',$arr['channel']) && intval($arr['channel']['channel_pageflags'])) {
// These flags cannot be sync'd.