Compare commits

...

18 Commits
7.8.1 ... 7.8.2

Author SHA1 Message Date
Mario
249bdeb642 Merge branch 'dev' 2022-11-05 10:26:14 +00:00
Mario
b4ee80d1ea changelog 2022-11-05 10:25:40 +00:00
Mario
96bf9d0769 version 7.8.2 2022-11-05 09:52:11 +00:00
Mario
7fc9c83986 Merge branch 'dev' 2022-11-05 09:50:55 +00:00
Mario
5502f1cc63 do not update the guid on xchan/hubloc updates and define some array keys 2022-11-04 10:31:05 +00:00
Mario
b55801323c fix warnings 2022-11-03 15:26:46 +00:00
Mario
818374c8cc wor around shares from streams not rendered correctly 2022-11-03 13:54:40 +00:00
Mario
e80191d4cd fix regression 2022-11-03 13:09:11 +00:00
Mario
c2a796b6ea rename variable and warning fixes 2022-11-03 11:57:35 +00:00
Mario
00694f0dfd css fixes 2022-11-02 19:19:24 +00:00
Mario
134f4c5b52 undefined array key 2022-11-02 18:59:47 +00:00
Mario
0840fc42f9 php warning 2022-11-02 18:49:36 +00:00
Mario
2650a647e9 php warnings 2022-11-02 18:32:52 +00:00
Mario Vavti
3311269162 throw a 404 if we could not determine which channel to load 2022-11-02 17:52:19 +01:00
Mario
b2172d39f6 re-install: if we have a cashed entry, make sure we fetch the latest 2022-11-02 15:54:12 +00:00
Mario Vavti
f4d39bd3c8 fix more php warnings 2022-11-02 16:52:42 +01:00
Mario Vavti
1cf659033b set hubloc_connected in mod fhublocs otherwise the hublocs might be removed by prune_hub_reinstalls() 2022-11-02 10:38:40 +01:00
Mario
3dc5527690 css variables 2022-10-31 14:01:00 +00:00
28 changed files with 196 additions and 161 deletions

View File

@@ -1,3 +1,11 @@
Hubzilla 7.8.2 (2022-11-05)
- Pubcrawl: fix regression in inbox
- Fix display issue of shares coming from streams
- Throw a 404 if we could not determine which channel to load
- If we have a cached xchan/hubloc entry, make sure we fetch the latest
- Gallery: paint the background grid with css
Hubzilla 7.8.1 (2022-10-26)
- Silence tons of PHP warnings in core
- Catch decryption failure edgecase in receiver

View File

@@ -657,7 +657,8 @@ class Notifier {
$hash = new_uuid();
$env = (($hub_env && $hub_env[$hub['hubloc_site_id']]) ? $hub_env[$hub['hubloc_site_id']] : '');
$env = $hub_env[$hub['hubloc_site_id']] ?? '';
if ((self::$private) && (!$env)) {
continue;
}

View File

@@ -1702,9 +1702,8 @@ class Activity {
);
// update existing xchan record
q("update xchan set xchan_name = '%s', xchan_guid = '%s', xchan_pubkey = '%s', xchan_addr = '%s', xchan_network = 'activitypub', xchan_name_date = '%s' where xchan_hash = '%s'",
q("update xchan set xchan_name = '%s', xchan_pubkey = '%s', xchan_addr = '%s', xchan_network = 'activitypub', xchan_name_date = '%s' where xchan_hash = '%s'",
dbesc(escape_tags($name)),
dbesc($url),
dbesc(escape_tags($pubkey)),
dbesc(escape_tags($webfinger_addr)),
dbescdate(datetime_convert()),
@@ -1712,8 +1711,7 @@ class Activity {
);
// update existing hubloc record
q("update hubloc set hubloc_guid = '%s', hubloc_addr = '%s', hubloc_network = 'activitypub', hubloc_url = '%s', hubloc_host = '%s', hubloc_callback = '%s', hubloc_updated = '%s', hubloc_id_url = '%s' where hubloc_hash = '%s'",
dbesc($url),
q("update hubloc set hubloc_addr = '%s', hubloc_network = 'activitypub', hubloc_url = '%s', hubloc_host = '%s', hubloc_callback = '%s', hubloc_updated = '%s', hubloc_id_url = '%s' where hubloc_hash = '%s'",
dbesc(escape_tags($webfinger_addr)),
dbesc($baseurl),
dbesc($hostname),
@@ -2208,6 +2206,8 @@ class Activity {
$s['owner_xchan'] = $act->actor['id'];
$s['author_xchan'] = $act->actor['id'];
$content = [];
if (is_array($act->obj)) {
$content = self::get_content($act->obj);
}
@@ -2280,10 +2280,10 @@ class Activity {
$mention = self::get_actor_bbmention($obj_actor['id']);
if ($act->type === 'Like') {
$content['content'] = sprintf(t('Likes %1$s\'s %2$s'), $mention, $act->obj['type']) . "\n\n" . $content['content'];
$content['content'] = sprintf(t('Likes %1$s\'s %2$s'), $mention, $act->obj['type']) . "\n\n" . $content['content'] ?? '';
}
if ($act->type === 'Dislike') {
$content['content'] = sprintf(t('Doesn\'t like %1$s\'s %2$s'), $mention, $act->obj['type']) . "\n\n" . $content['content'];
$content['content'] = sprintf(t('Doesn\'t like %1$s\'s %2$s'), $mention, $act->obj['type']) . "\n\n" . $content['content'] ?? '';
}
// handle event RSVPs
@@ -2791,11 +2791,7 @@ class Activity {
call_hooks('decode_note', $hookinfo);
$s = $hookinfo['s'];
return $s;
return $hookinfo['s'];
}
@@ -3823,7 +3819,7 @@ class Activity {
}
if (array_path_exists('source/mediaType', $act) && array_path_exists('source/content', $act)) {
if ($act['source']['mediaType'] === 'text/bbcode') {
if (in_array($act['source']['mediaType'], ['text/bbcode', 'text/x-multicode'])) {
$content['bbcode'] = purify_html($act['source']['content']);
}
}

View File

@@ -69,7 +69,7 @@ class Connect {
$xchan_hash = '';
$sql_options = (($protocol) ? " and xchan_network = '" . dbesc($protocol) . "' " : '');
$r = q("select * from xchan where ( xchan_hash = '%s' or xchan_url = '%s' or xchan_addr = '%s') $sql_options ",
$r = q("SELECT * FROM xchan LEFT JOIN hubloc ON xchan_hash = hubloc_hash WHERE ( xchan_hash = '%s' or xchan_url = '%s' or xchan_addr = '%s') $sql_options ORDER BY hubloc_id DESC",
dbesc($url),
dbesc($url),
dbesc($url)
@@ -80,7 +80,7 @@ class Connect {
// reset results to the best record or the first if we don't have the best
// note: this is a single record and not an array of results
$r = Libzot::zot_record_preferred($r,'xchan_network');
$r = Libzot::zot_record_preferred($r, 'xchan_network');
}
@@ -120,7 +120,7 @@ class Connect {
// convert to a single record (once again preferring a zot solution in the case of multiples)
if ($r) {
$r = Libzot::zot_record_preferred($r,'xchan_network');
$r = Libzot::zot_record_preferred($r, 'xchan_network');
}
}

View File

@@ -869,7 +869,7 @@ class Enotify {
$x = array(
'notify_link' => $item['llink'],
'name' => $item[$who]['xchan_name'],
'addr' => (($item[$who]['xchan_addr']) ? $item[$who]['xchan_addr'] : $item[$who]['xchan_url']),
'addr' => $item[$who]['xchan_addr'] ?? $item[$who]['xchan_url'],
'url' => $item[$who]['xchan_url'],
'photo' => $item[$who]['xchan_photo_s'],
'when' => (($edit) ? datetime_convert('UTC', date_default_timezone_get(), $item['edited']) : datetime_convert('UTC', date_default_timezone_get(), $item['created'])),

View File

@@ -202,6 +202,8 @@ class Libsync {
$channel = $r[0];
$mid = 'sync';
$DR->set_name($channel['channel_name'] . ' <' . channel_reddress($channel) . '>');
$max_friends = service_class_fetch($channel['channel_id'], 'total_channels');
@@ -293,8 +295,10 @@ class Libsync {
if (array_key_exists('event_item', $arr) && $arr['event_item'])
sync_items($channel, $arr['event_item'], ((array_key_exists('relocate', $arr)) ? $arr['relocate'] : null));
if (array_key_exists('item', $arr) && $arr['item'])
if (array_key_exists('item', $arr) && $arr['item']) {
sync_items($channel, $arr['item'], ((array_key_exists('relocate', $arr)) ? $arr['relocate'] : null));
$mid = $arr['item']['mid'] . '#sync';
}
// deprecated, maintaining for a few months for upward compatibility
// this should sync webpages, but the logic is a bit subtle
@@ -740,7 +744,7 @@ class Libsync {
*/
call_hooks('process_channel_sync_delivery', $addon);
$DR = new DReport(z_root(), $d, $d, 'sync', 'channel sync delivered');
$DR = new DReport(z_root(), $d, $d, $mid, 'channel sync processed');
$DR->set_name($channel['channel_name'] . ' <' . channel_reddress($channel) . '>');

View File

@@ -1172,10 +1172,14 @@ class Libzot {
return;
}
if (is_array($AS->obj)) {
$arr = Activity::decode_note($AS);
$item = Activity::decode_note($AS);
if (!$item) {
logger('Could not decode activity: ' . print_r($AS, true));
return;
}
}
else {
$arr = [];
$item = [];
}
logger($AS->debug(), LOGGER_DATA);
@@ -1260,15 +1264,15 @@ class Libzot {
if ($r) {
$r = self::zot_record_preferred($r);
$arr['author_xchan'] = $r['hubloc_hash'];
$item['author_xchan'] = $r['hubloc_hash'];
}
if (! $arr['author_xchan']) {
if (! $item['author_xchan']) {
logger('No author!');
return;
}
$arr['owner_xchan'] = $env['sender'];
$item['owner_xchan'] = $env['sender'];
if(filter_var($env['sender'], FILTER_VALIDATE_URL)) {
// in individual delivery, change owner if needed
@@ -1277,67 +1281,67 @@ class Libzot {
);
if ($s) {
$arr['owner_xchan'] = $s[0]['hubloc_hash'];
$item['owner_xchan'] = $s[0]['hubloc_hash'];
}
}
if (! $arr['owner_xchan']) {
if (! $item['owner_xchan']) {
logger('No owner!');
return;
}
if ($private && (!intval($arr['item_private']))) {
$arr['item_private'] = 1;
if ($private && (!intval($item['item_private']))) {
$item['item_private'] = 1;
}
if ($arr['mid'] === $arr['parent_mid']) {
if ($item['mid'] === $item['parent_mid']) {
if (is_array($AS->obj) && array_key_exists('commentPolicy', $AS->obj)) {
$p = strstr($AS->obj['commentPolicy'], 'until=');
if ($p !== false) {
$comments_closed_at = datetime_convert('UTC', 'UTC', substr($p, 6));
if ($comments_closed_at === $arr['created']) {
$arr['item_nocomment'] = 1;
if ($comments_closed_at === $item['created']) {
$item['item_nocomment'] = 1;
}
else {
$arr['comments_closed'] = $comments_closed_at;
$arr['comment_policy'] = trim(str_replace($p, '', $AS->obj['commentPolicy']));
$item['comments_closed'] = $comments_closed_at;
$aritemr['comment_policy'] = trim(str_replace($p, '', $AS->obj['commentPolicy']));
}
}
else {
$arr['comment_policy'] = $AS->obj['commentPolicy'];
$item['comment_policy'] = $AS->obj['commentPolicy'];
}
}
}
if (isset($AS->meta['hubloc']) && $AS->meta['hubloc']) {
$arr['item_verified'] = true;
$item['item_verified'] = true;
}
if (!array_key_exists('comment_policy', $arr)) {
$arr['comment_policy'] = 'authenticated';
if (!array_key_exists('comment_policy', $item)) {
$item['comment_policy'] = 'authenticated';
}
if (isset($AS->meta['signed_data']) && $AS->meta['signed_data']) {
IConfig::Set($arr, 'activitypub', 'signed_data', $AS->meta['signed_data'], false);
IConfig::Set($item, 'activitypub', 'signed_data', $AS->meta['signed_data'], false);
}
logger('Activity received: ' . print_r($arr, true), LOGGER_DATA, LOG_DEBUG);
logger('Activity received: ' . print_r($item, true), LOGGER_DATA, LOG_DEBUG);
logger('Activity recipients: ' . print_r($deliveries, true), LOGGER_DATA, LOG_DEBUG);
$relay = (($env['type'] === 'response') ? true : false);
$result = self::process_delivery($env['sender'], $AS, $arr, $deliveries, $relay, false, $message_request);
$result = self::process_delivery($env['sender'], $AS, $item, $deliveries, $relay, false, $message_request);
}
elseif ($env['type'] === 'sync') {
// $arr = get_channelsync_elements($data);
// $item = get_channelsync_elements($data);
$arr = json_decode($data, true);
$item = json_decode($data, true);
logger('Channel sync received: ' . print_r($arr, true), LOGGER_DATA, LOG_DEBUG);
logger('Channel sync received: ' . print_r($item, true), LOGGER_DATA, LOG_DEBUG);
logger('Channel sync recipients: ' . print_r($deliveries, true), LOGGER_DATA, LOG_DEBUG);
if ($env['encoding'] === 'hz') {
$result = Libsync::process_channel_sync_delivery($env['sender'], $arr, $deliveries);
$result = Libsync::process_channel_sync_delivery($env['sender'], $item, $deliveries);
}
else {
logger('sync packet type not supported.');
@@ -1920,7 +1924,7 @@ class Libzot {
// preserve conversations with which you are involved from expiration
$stored = (($item_result && $item_result['item']) ? $item_result['item'] : false);
$stored = ((isset($item_result['item'])) ? $item_result['item'] : false);
if ((is_array($stored)) && ($stored['id'] != $stored['parent'])
&& ($stored['author_xchan'] === $channel['channel_hash'])) {
retain_item($stored['item']['parent']);

View File

@@ -84,10 +84,8 @@ class ThreadItem {
public function get_template_data($conv_responses, $thread_level=1, $conv_flags = []) {
$result = array();
$item = $this->get_data();
$result = [];
$item = $this->get_data();
$commentww = '';
$sparkle = '';
$buttons = '';

View File

@@ -304,7 +304,7 @@ class Acl extends \Zotlabs\Web\Controller {
}
elseif($type == 'a') {
$r = q("SELECT abook_id as id, xchan_name as name, xchan_network as net, xchan_hash as hash, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url, xchan_addr as attag , abook_their_perms FROM abook left join xchan on abook_xchan = xchan_hash
$r = q("SELECT abook_id as id, xchan_name as name, xchan_network as net, xchan_hash as hash, xchan_addr as nick, xchan_photo_s as micro, xchan_url as url, xchan_addr as attag, abook_their_perms, abook_self FROM abook left join xchan on abook_xchan = xchan_hash
WHERE abook_channel = %d
and xchan_deleted = 0
$sql_extra3

View File

@@ -31,8 +31,10 @@ class Channel extends Controller {
goaway(z_root() . '/search?f=&search=' . $_GET['search']);
$which = null;
if (argc() > 1)
if (argc() > 1) {
$which = argv(1);
}
if (!$which) {
if (local_channel()) {
$channel = App::get_channel();
@@ -40,9 +42,9 @@ class Channel extends Controller {
$which = $channel['channel_address'];
}
}
if (!$which) {
notice(t('You must be logged in to see this page.') . EOL);
return;
http_status_exit(404, 'Not found');
}
$profile = 0;

View File

@@ -357,7 +357,7 @@ class Connections extends \Zotlabs\Web\Controller {
'oneway' => $oneway,
'perminfo' => $perminfo,
'connect' => (intval($rr['abook_not_here']) ? t('Connect') : ''),
'follow' => z_root() . '/follow/?f=&url=' . urlencode($rr['xchan_hash']) . '&interactive=0',
'follow' => z_root() . '/follow/?f=&url=' . urlencode($rr['xchan_hash']) . '&interactive=1',
'connect_hover' => t('Connect at this location'),
'role' => $roles_dict[$rr['abook_role']] ?? '',
'pending' => intval($rr['abook_pending'])

View File

@@ -90,6 +90,7 @@ class Display extends \Zotlabs\Web\Controller {
);
$o .= '<div id="jot-popup">';
$a = '';
$o .= status_editor($a,$x,false,'Display');
$o .= '</div>';
}
@@ -307,71 +308,71 @@ class Display extends \Zotlabs\Web\Controller {
$items = array();
}
switch($module_format) {
case 'html':
case 'html':
if ($update) {
$o .= conversation($items, 'display', $update, 'client');
}
else {
$o .= '<noscript>';
if($noscript_content) {
$o .= conversation($items, 'display', $update, 'traditional');
if ($update) {
$o .= conversation($items, 'display', $update, 'client');
}
else {
$o .= '<div class="section-content-warning-wrapper">' . t('You must enable javascript for your browser to be able to view this content.') . '</div>';
$o .= '<noscript>';
if($noscript_content) {
$o .= conversation($items, 'display', $update, 'traditional');
}
else {
$o .= '<div class="section-content-warning-wrapper">' . t('You must enable javascript for your browser to be able to view this content.') . '</div>';
}
$o .= '</noscript>';
if (isset($items[0]['title'])) {
App::$page['title'] = $items[0]['title'] . ' - ' . App::$page['title'];
}
$o .= conversation($items, 'display', $update, 'client');
}
$o .= '</noscript>';
App::$page['title'] = (($items[0]['title']) ? $items[0]['title'] . " - " . App::$page['title'] : App::$page['title']);
break;
$o .= conversation($items, 'display', $update, 'client');
}
case 'atom':
break;
$atom = replace_macros(get_markup_template('atom_feed.tpl'), array(
'$version' => xmlify(\Zotlabs\Lib\System::get_project_version()),
'$generator' => xmlify(\Zotlabs\Lib\System::get_platform_name()),
'$generator_uri' => 'https://hubzilla.org',
'$feed_id' => xmlify(App::$cmd),
'$feed_title' => xmlify(t('Article')),
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now', ATOM_TIME)),
'$author' => '',
'$owner' => '',
'$profile_page' => xmlify(z_root() . '/display/' . gen_link_id($target_item['mid'])),
));
case 'atom':
$x = [ 'xml' => $atom, 'channel' => $channel, 'observer_hash' => $observer_hash, 'params' => $params ];
call_hooks('atom_feed_top',$x);
$atom = replace_macros(get_markup_template('atom_feed.tpl'), array(
'$version' => xmlify(\Zotlabs\Lib\System::get_project_version()),
'$generator' => xmlify(\Zotlabs\Lib\System::get_platform_name()),
'$generator_uri' => 'https://hubzilla.org',
'$feed_id' => xmlify(App::$cmd),
'$feed_title' => xmlify(t('Article')),
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', 'now', ATOM_TIME)),
'$author' => '',
'$owner' => '',
'$profile_page' => xmlify(z_root() . '/display/' . gen_link_id($target_item['mid'])),
));
$atom = $x['xml'];
$x = [ 'xml' => $atom, 'channel' => $channel, 'observer_hash' => $observer_hash, 'params' => $params ];
call_hooks('atom_feed_top',$x);
$atom = $x['xml'];
// a much simpler interface
call_hooks('atom_feed', $atom);
// a much simpler interface
call_hooks('atom_feed', $atom);
if($items) {
$type = 'html';
foreach($items as $item) {
if($item['item_private'])
continue;
$atom .= atom_entry($item, $type, null, '', true, '', false);
if($items) {
$type = 'html';
foreach($items as $item) {
if($item['item_private'])
continue;
$atom .= atom_entry($item, $type, null, '', true, '', false);
}
}
}
call_hooks('atom_feed_end', $atom);
call_hooks('atom_feed_end', $atom);
$atom .= '</feed>' . "\r\n";
header('Content-type: application/atom+xml');
echo $atom;
killme();
$atom .= '</feed>' . "\r\n";
header('Content-type: application/atom+xml');
echo $atom;
killme();
}
$o .= '<div id="content-complete"></div>';

View File

@@ -56,10 +56,12 @@ class Dreport extends \Zotlabs\Web\Controller {
return;
}
$r = q("select * from dreport where dreport_xchan = '%s' and (dreport_mid = '%s' or dreport_mid = '%s')",
$r = q("select * from dreport where dreport_xchan = '%s' and (dreport_mid = '%s' or dreport_mid = '%s' or dreport_mid = '%s' or dreport_mid = '%s')",
dbesc($channel['channel_hash']),
dbesc($mid),
dbesc(str_replace('/item/', '/activity/', $mid))
dbesc($mid . '#sync'),
dbesc(str_replace('/item/', '/activity/', $mid)),
dbesc(str_replace('/item/', '/activity/', $mid) . '#sync')
);
if(! $r) {

View File

@@ -60,20 +60,21 @@ class Fhublocs extends \Zotlabs\Web\Controller {
$h = hubloc_store_lowlevel(
[
'hubloc_guid' => $rr['channel_guid'],
'hubloc_guid_sig' => $rr['channel_guid_sig'],
'hubloc_hash' => $rr['channel_hash'],
'hubloc_id_url' => channel_url($rr),
'hubloc_addr' => channel_reddress($rr),
'hubloc_primary' => intval($primary),
'hubloc_url' => z_root(),
'hubloc_url_sig' => Libzot::sign(z_root(), $rr['channel_prvkey']),
'hubloc_site_id' => Libzot::make_xchan_hash(z_root(), $sitekey),
'hubloc_host' => \App::get_hostname(),
'hubloc_callback' => z_root() . '/zot',
'hubloc_sitekey' => $sitekey,
'hubloc_network' => 'zot6',
'hubloc_updated' => datetime_convert()
'hubloc_guid' => $rr['channel_guid'],
'hubloc_guid_sig' => $rr['channel_guid_sig'],
'hubloc_hash' => $rr['channel_hash'],
'hubloc_id_url' => channel_url($rr),
'hubloc_addr' => channel_reddress($rr),
'hubloc_primary' => intval($primary),
'hubloc_url' => z_root(),
'hubloc_url_sig' => Libzot::sign(z_root(), $rr['channel_prvkey']),
'hubloc_site_id' => Libzot::make_xchan_hash(z_root(), $sitekey),
'hubloc_host' => \App::get_hostname(),
'hubloc_callback' => z_root() . '/zot',
'hubloc_sitekey' => $sitekey,
'hubloc_network' => 'zot6',
'hubloc_updated' => datetime_convert(),
'hubloc_connected' => datetime_convert()
]
);

View File

@@ -15,7 +15,7 @@ class Oep extends \Zotlabs\Web\Controller {
logger('oep: ' . print_r($_REQUEST,true), LOGGER_DEBUG, LOG_INFO);
$html = ((argc() > 1 && argv(1) === 'html') ? true : false);
if($_REQUEST['url']) {
if(isset($_REQUEST['url'])) {
$_REQUEST['url'] = strip_zids($_REQUEST['url']);
$url = $_REQUEST['url'];
}
@@ -23,9 +23,9 @@ class Oep extends \Zotlabs\Web\Controller {
if(! $url)
http_status_exit(404, 'Not found');
$maxwidth = $_REQUEST['maxwidth'];
$maxheight = $_REQUEST['maxheight'];
$format = $_REQUEST['format'];
$maxwidth = $_REQUEST['maxwidth'] ?? 0;
$maxheight = $_REQUEST['maxheight'] ?? 0;
$format = $_REQUEST['format'] ?? '';
if($format && $format !== 'json')
http_status_exit(501, 'Not implemented');
@@ -70,8 +70,8 @@ class Oep extends \Zotlabs\Web\Controller {
$ret = array();
$url = $args['url'];
$maxwidth = intval($args['maxwidth']);
$maxheight = intval($args['maxheight']);
$maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0);
$maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0);
if(preg_match('#//(.*?)/display/(.*?)(&|\?|$)#',$url,$matches)) {
$res = $matches[2];
@@ -159,8 +159,8 @@ class Oep extends \Zotlabs\Web\Controller {
$ret = [];
$url = $args['url'];
$maxwidth = intval($args['maxwidth']);
$maxheight = intval($args['maxheight']);
$maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0);
$maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0);
if(preg_match('#//(.*?)/cards/(.*?)/(.*?)(&|\?|$)#',$url,$matches)) {
$nick = $matches[2];
@@ -246,8 +246,8 @@ class Oep extends \Zotlabs\Web\Controller {
$ret = [];
$url = $args['url'];
$maxwidth = intval($args['maxwidth']);
$maxheight = intval($args['maxheight']);
$maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0);
$maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0);
if(preg_match('#//(.*?)/articles/(.*?)/(.*?)(&|\?|$)#',$url,$matches)) {
$nick = $matches[2];
@@ -333,8 +333,8 @@ class Oep extends \Zotlabs\Web\Controller {
$ret = array();
$url = $args['url'];
$maxwidth = intval($args['maxwidth']);
$maxheight = intval($args['maxheight']);
$maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0);
$maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0);
if(preg_match('#//(.*?)/(.*?)/(.*?)/(.*?)mid\=(.*?)(&|$)#',$url,$matches)) {
$chn = $matches[3];
@@ -454,8 +454,8 @@ class Oep extends \Zotlabs\Web\Controller {
$ret = array();
$url = $args['url'];
$maxwidth = intval($args['maxwidth']);
$maxheight = intval($args['maxheight']);
$maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0);
$maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0);
if(preg_match('|//(.*?)/(.*?)/(.*?)/album/|',$url,$matches)) {
$chn = $matches[3];
@@ -519,8 +519,8 @@ class Oep extends \Zotlabs\Web\Controller {
$ret = array();
$url = $args['url'];
$maxwidth = intval($args['maxwidth']);
$maxheight = intval($args['maxheight']);
$maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0);
$maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0);
if(preg_match('|//(.*?)/(.*?)/(.*?)$|',$url,$matches)) {
$chn = $matches[3];
@@ -582,8 +582,8 @@ class Oep extends \Zotlabs\Web\Controller {
$ret = array();
$url = $args['url'];
$maxwidth = intval($args['maxwidth']);
$maxheight = intval($args['maxheight']);
$maxwidth = ((isset($args['maxwidth'])) ? $args['maxwidth'] : 0);
$maxheight = ((isset($args['maxheight'])) ? $args['maxheight'] : 0);
if(preg_match('|//(.*?)/(.*?)/(.*?)/image/|',$url,$matches)) {
$chn = $matches[3];

View File

@@ -13,8 +13,9 @@ class Pconfig extends \Zotlabs\Web\Controller {
return;
if($_SESSION['delegate'])
if(isset($_SESSION['delegate'])) {
return;
}
check_form_security_token_redirectOnErr('/pconfig', 'pconfig');

View File

@@ -26,7 +26,7 @@ class Register extends Controller {
// created a channel, we'll try to revive the connection request
// and process it.
if($_REQUEST['connect'])
if(isset($_REQUEST['connect']))
$_SESSION['connect'] = $_REQUEST['connect'];
switch($cmd) {

View File

@@ -5,8 +5,8 @@ namespace Zotlabs\Module;
class Update extends \Zotlabs\Web\Controller {
function get() {
$profile_uid = intval($_GET['p']);
$profile_uid = $_GET['p'] ?? 0;
// it's probably safe to do this for all modules and not just a limited subset,
// but it needs to be verified.
@@ -23,7 +23,7 @@ class Update extends \Zotlabs\Web\Controller {
if(in_array(strtolower(argv(1)),['articles','cards']))
killme();
$module = "\\Zotlabs\\Module\\" . ucfirst(argv(1));
$module = "\\Zotlabs\\Module\\" . ucfirst(argv(1));
$load = (((argc() > 2) && (argv(2) == 'load')) ? 1 : 0);
$mod = new $module;
@@ -38,6 +38,6 @@ class Update extends \Zotlabs\Web\Controller {
echo "</section></body></html>\r\n";
killme();
}
}

View File

@@ -148,7 +148,7 @@ class Messages {
}
$entries[$i]['author_name'] = $item['author']['xchan_name'];
$entries[$i]['author_addr'] = (($item['author']['xchan_addr']) ? $item['author']['xchan_addr'] : $item['author']['xchan_url']);
$entries[$i]['author_addr'] = $item['author']['xchan_addr'] ?? $item['author']['xchan_url'];
$entries[$i]['info'] = $info;
$entries[$i]['created'] = datetime_convert('UTC', date_default_timezone_get(), $item['created']);
$entries[$i]['summary'] = $summary;

View File

@@ -71,7 +71,10 @@ class Zot6Handler implements IHandler {
where xchan_hash ='%s' limit 1",
dbesc($recip)
);
$x = Libzot::refresh([ 'hubloc_id_url' => $hub['hubloc_id_url']], $r[0], $force);
if ($r) {
$x = Libzot::refresh([ 'hubloc_id_url' => $hub['hubloc_id_url']], $r[0], $force);
}
}
}
else {

View File

@@ -60,7 +60,7 @@ require_once('include/bbcode.php');
require_once('include/items.php');
define('PLATFORM_NAME', 'hubzilla');
define('STD_VERSION', '7.8.1');
define('STD_VERSION', '7.8.2');
define('ZOT_REVISION', '6.0');
define('DB_UPDATE_VERSION', 1253);

View File

@@ -384,7 +384,7 @@ function contact_remove($channel_id, $abook_id) {
dbesc($abook['abook_xchan'])
);
if ($xchan && strpos($xchan['xchan_addr'],'guest:') === 0 && strpos($abook['abook_xchan'],'.')){
if ($xchan && strpos($xchan[0]['xchan_addr'],'guest:') === 0 && strpos($abook['abook_xchan'],'.')){
$atoken_guid = substr($abook['abook_xchan'],strrpos($abook['abook_xchan'],'.') + 1);
if ($atoken_guid) {
atoken_delete_and_sync($channel_id,$atoken_guid);

View File

@@ -503,11 +503,22 @@ function ev_compare($a, $b) {
function event_store_event($arr) {
$arr['created'] = (($arr['created']) ? $arr['created'] : datetime_convert());
$arr['edited'] = (($arr['edited']) ? $arr['edited'] : datetime_convert());
$arr['etype'] = (($arr['etype']) ? $arr['etype'] : 'event' );
$arr['event_xchan'] = (($arr['event_xchan']) ? $arr['event_xchan'] : '');
$arr['event_priority'] = (($arr['event_priority']) ? $arr['event_priority'] : 0);
$arr['created'] = $arr['created'] ?? datetime_convert();
$arr['edited'] = $arr['edited'] ?? datetime_convert();
$arr['etype'] = $arr['etype'] ?? 'event';
$arr['event_xchan'] = $arr['event_xchan'] ?? '';
$arr['event_priority'] = $arr['event_priority'] ?? 0;
$arr['location'] = $arr['location'] ?? '';
$arr['nofinish'] = $arr['nofinish'] ?? 0;
$arr['event_status'] = $arr['event_status'] ?? '';
$arr['event_percent'] = $arr['event_percent'] ?? 0;
$arr['event_repeat'] = $arr['event_repeat'] ?? '';
$arr['event_sequence'] = $arr['event_sequence'] ?? 0;
$arr['event_vdata'] = $arr['event_vdata'] ?? '';
$arr['allow_cid'] = $arr['allow_cid'] ?? '';
$arr['allow_gid'] = $arr['allow_gid'] ?? '';
$arr['deny_cid'] = $arr['deny_cid'] ?? '';
$arr['deny_gid'] = $arr['deny_gid'] ?? '';
if (! $arr['dtend']) {
$arr['dtend'] = NULL_DATE;
@@ -522,7 +533,7 @@ function event_store_event($arr) {
$existing_event = null;
if($arr['event_hash']) {
if(isset($arr['event_hash'])) {
$r = q("SELECT * FROM event WHERE event_hash = '%s' AND uid = %d LIMIT 1",
dbesc($arr['event_hash']),
intval($arr['uid'])
@@ -532,7 +543,7 @@ function event_store_event($arr) {
}
}
if($arr['id']) {
if(isset($arr['id'])) {
$r = q("SELECT * FROM event WHERE id = %d AND uid = %d LIMIT 1",
intval($arr['id']),
intval($arr['uid'])
@@ -1169,7 +1180,7 @@ function event_store_item($arr, $event) {
$item = null;
if($arr['mid'] && $arr['uid']) {
if(isset($arr['mid'], $arr['uid'])) {
$i = q("select * from item where mid = '%s' and uid = %d limit 1",
dbesc($arr['mid']),
intval($arr['uid'])

View File

@@ -1892,8 +1892,8 @@ function format_poll($item,$s,$opts) {
return EMPTY_STR;
}
$closed = false;
$commentable = can_comment_on_post(((local_channel()) ? get_observer_hash() : EMPTY_STR), $item);
$activated = ((local_channel() && local_channel() == $item['uid'] && get_observer_hash() !== $item['owner_xchan']) ? true : false);
$output = $s;

View File

@@ -12,6 +12,7 @@
--bs-border-radius: $radius;
--bs-link-color: $link_colour;
--bs-link-hover-color: $link_hover_colour;
--bs-body-bg: $bgcolour;
}
.nav-tabs {
@@ -39,7 +40,7 @@ html {
body {
font-size: 0.9rem;
background-color: $bgcolour;
background-color: var(--bs-body-bg);
background-image: url('$background_image');
background-attachment: fixed;
background-size: cover;
@@ -1263,7 +1264,7 @@ img.mail-conv-sender-photo {
}
.generic-content-wrapper-styled {
background-color: $bgcolour;
background-color: var(--bs-body-bg);
padding: 10px;
border-radius: var(--bs-border-radius);
}

View File

@@ -2,6 +2,8 @@
:root {
color-scheme: dark;
--bs-dark-rgb: #e1e1e1;
--bs-border-color: rgba(250, 250, 250, 0.125);
--bs-body-bg: #111;
}
.widget,
@@ -10,16 +12,16 @@
}
.comment-edit-text {
border: 1px solid rgba(250, 250, 250, 0.125);
border: 1px solid var(--bs-border-color);
}
.generic-content-wrapper {
border: 1px solid rgba(250, 250, 250, 0.125);
border: 1px solid var(--bs-border-color);
}
#profile-jot-wrapper {
background-color: unset;
border: 1px solid rgba(250, 250, 250, 0.125);
border: 1px solid var(--bs-border-color);
}
.bootstrap-tagsinput {
@@ -30,4 +32,3 @@ a,
.fakelink {
color: var(--bs-link-color);
}

View File

@@ -5,7 +5,7 @@
{{foreach $items as $i}}
<a href="{{$i.url}}" title="{{$i.alt}}">
<img src="{{$i.src}}" width="{{$i.width}}" height="{{$i.height}}" alt="{{$i.alt}}">
<div class='jg-caption autotime' title="{{$i.edited}}"></div>
<div class='jg-caption rounded text-truncate autotime' title="{{$i.edited}}"></div>
</a>
{{/foreach}}
</div>

View File

@@ -1,4 +1,5 @@
<a href="{{$photo.link}}" id="photo-top-photo-link-{{$photo.id}}" title="{{$photo.title}}">
<img src="{{$photo.src}}" alt="{{if $photo.album.name}}{{$photo.album.name}}{{elseif $photo.desc}}{{$photo.desc}}{{elseif $photo.alt}}{{$photo.alt}}{{else}}{{$photo.unknown}}{{/if}}" title="{{$photo.title}}" id="photo-top-photo-{{$photo.id}}" loading="lazy" />
<div class="jg-caption rounded text-truncate">{{if $photo.album.name}}{{$photo.album.name}}{{elseif $photo.desc}}{{$photo.desc}}{{elseif $photo.alt}}{{$photo.alt}}{{else}}{{$photo.unknown}}{{/if}}</div>
</a>