Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
This commit is contained in:
commit
61bf77f668
@ -35,6 +35,7 @@ class Getfile extends \Zotlabs\Web\Controller {
|
|||||||
$sig = $_POST['signature'];
|
$sig = $_POST['signature'];
|
||||||
$resource = $_POST['resource'];
|
$resource = $_POST['resource'];
|
||||||
$revision = intval($_POST['revision']);
|
$revision = intval($_POST['revision']);
|
||||||
|
$resolution = (-1);
|
||||||
|
|
||||||
if(! $hash)
|
if(! $hash)
|
||||||
killme();
|
killme();
|
||||||
@ -46,6 +47,11 @@ class Getfile extends \Zotlabs\Web\Controller {
|
|||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(substr($resource,-2,1) == '-') {
|
||||||
|
$resolution = intval(substr($resource,-1,1));
|
||||||
|
$resource = substr($resource,0,-2);
|
||||||
|
}
|
||||||
|
|
||||||
$slop = intval(get_pconfig($channel['channel_id'],'system','getfile_time_slop'));
|
$slop = intval(get_pconfig($channel['channel_id'],'system','getfile_time_slop'));
|
||||||
if($slop < 1)
|
if($slop < 1)
|
||||||
$slop = 3;
|
$slop = 3;
|
||||||
@ -63,6 +69,35 @@ class Getfile extends \Zotlabs\Web\Controller {
|
|||||||
killme();
|
killme();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if($resolution > 0) {
|
||||||
|
$r = q("select * from photo where resource_id = '%s' and uid = %d limit 1",
|
||||||
|
dbesc($resource),
|
||||||
|
intval($channel['channel_id'])
|
||||||
|
);
|
||||||
|
if($r) {
|
||||||
|
header('Content-type: ' . $r[0]['mimetype']);
|
||||||
|
|
||||||
|
if(intval($r[0]['os_storage'])) {
|
||||||
|
$fname = dbunescbin($r[0]['content']);
|
||||||
|
if(strpos($fname,'store') !== false)
|
||||||
|
$istream = fopen($fname,'rb');
|
||||||
|
else
|
||||||
|
$istream = fopen('store/' . $channel['channel_address'] . '/' . $fname,'rb');
|
||||||
|
$ostream = fopen('php://output','wb');
|
||||||
|
if($istream && $ostream) {
|
||||||
|
pipe_streams($istream,$ostream);
|
||||||
|
fclose($istream);
|
||||||
|
fclose($ostream);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo dbunescbin($r[0]['content']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
killme();
|
||||||
|
}
|
||||||
|
|
||||||
$r = attach_by_hash($resource,$channel['channel_hash'],$revision);
|
$r = attach_by_hash($resource,$channel['channel_hash'],$revision);
|
||||||
|
|
||||||
if(! $r['success']) {
|
if(! $r['success']) {
|
||||||
|
2
boot.php
2
boot.php
@ -50,7 +50,7 @@ require_once('include/attach.php');
|
|||||||
|
|
||||||
|
|
||||||
define ( 'PLATFORM_NAME', 'hubzilla' );
|
define ( 'PLATFORM_NAME', 'hubzilla' );
|
||||||
define ( 'STD_VERSION', '2.5.2' );
|
define ( 'STD_VERSION', '2.5.3' );
|
||||||
define ( 'ZOT_REVISION', '1.2' );
|
define ( 'ZOT_REVISION', '1.2' );
|
||||||
|
|
||||||
define ( 'DB_UPDATE_VERSION', 1191 );
|
define ( 'DB_UPDATE_VERSION', 1191 );
|
||||||
|
@ -118,6 +118,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
|
|||||||
[zrl=[baseurl]/help/hook/connect_premium]connect_premium[/zrl]
|
[zrl=[baseurl]/help/hook/connect_premium]connect_premium[/zrl]
|
||||||
Called when connecting to a premium channel
|
Called when connecting to a premium channel
|
||||||
|
|
||||||
|
[zrl=[baseurl]/help/hook/connection_remove]connection_remove[/zrl]
|
||||||
|
Called when deleting/removing a connection
|
||||||
|
|
||||||
[zrl=[baseurl]/help/hook/connector_settings]connector_settings[/zrl]
|
[zrl=[baseurl]/help/hook/connector_settings]connector_settings[/zrl]
|
||||||
Called when posting to the features/addon settings page
|
Called when posting to the features/addon settings page
|
||||||
|
|
||||||
|
@ -341,6 +341,11 @@ function contact_remove($channel_id, $abook_id) {
|
|||||||
|
|
||||||
logger('removing contact ' . $abook_id . ' for channel ' . $channel_id,LOGGER_DEBUG);
|
logger('removing contact ' . $abook_id . ' for channel ' . $channel_id,LOGGER_DEBUG);
|
||||||
|
|
||||||
|
|
||||||
|
$x = [ 'channel_id' => $channel_id, 'abook_id' => $abook_id ];
|
||||||
|
call_hooks('connection_remove',$x);
|
||||||
|
|
||||||
|
|
||||||
$archive = get_pconfig($channel_id, 'system','archive_removed_contacts');
|
$archive = get_pconfig($channel_id, 'system','archive_removed_contacts');
|
||||||
if($archive) {
|
if($archive) {
|
||||||
q("update abook set abook_archived = 1 where abook_id = %d and abook_channel = %d",
|
q("update abook set abook_archived = 1 where abook_id = %d and abook_channel = %d",
|
||||||
|
@ -1185,6 +1185,10 @@ function feed_meta($xml) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(! $author['author_photo'])
|
||||||
|
$author['author_photo'] = $feed->get_image_url();
|
||||||
|
|
||||||
|
|
||||||
if(substr($author['author_link'],-1,1) == '/')
|
if(substr($author['author_link'],-1,1) == '/')
|
||||||
$author['author_link'] = substr($author['author_link'],0,-1);
|
$author['author_link'] = substr($author['author_link'],0,-1);
|
||||||
|
|
||||||
|
@ -1093,11 +1093,12 @@ function sync_files($channel, $files) {
|
|||||||
$ext = '';
|
$ext = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = q("select filename from attach where ( filename = '%s' OR filename like '%s' ) and folder = '%s' and hash != '%s' ",
|
$r = q("select filename from attach where ( filename = '%s' OR filename like '%s' ) and folder = '%s' and hash != '%s' and uid = %d ",
|
||||||
dbesc($basename . $ext),
|
dbesc($basename . $ext),
|
||||||
dbesc($basename . '(%)' . $ext),
|
dbesc($basename . '(%)' . $ext),
|
||||||
dbesc($att['folder']),
|
dbesc($att['folder']),
|
||||||
dbesc($att['hash'])
|
dbesc($att['hash']),
|
||||||
|
intval($channel['channel_id'])
|
||||||
);
|
);
|
||||||
|
|
||||||
if($r) {
|
if($r) {
|
||||||
@ -1263,7 +1264,7 @@ function sync_files($channel, $files) {
|
|||||||
$r = dbq("update photo set " . $str . " where id = " . intval($exists[0]['id']) );
|
$r = dbq("update photo set " . $str . " where id = " . intval($exists[0]['id']) );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
create_attach_from_array('photo',$p);
|
create_table_from_array('photo',$p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user