diff options
-rw-r--r-- | CHANGELOG | 34 | ||||
-rw-r--r-- | Zotlabs/Module/Magic.php | 3 | ||||
-rw-r--r-- | Zotlabs/Module/Photos.php | 8 | ||||
-rw-r--r-- | Zotlabs/Module/Sse.php | 3 | ||||
-rw-r--r-- | include/channel.php | 5 | ||||
-rw-r--r-- | include/feedutils.php | 14 | ||||
-rw-r--r-- | include/menu.php | 24 | ||||
-rw-r--r-- | include/opengraph.php | 2 |
8 files changed, 67 insertions, 26 deletions
@@ -1,3 +1,37 @@ +Hubzilla 5.6 (2021-05-11) + - Improve postgres hubloc queries + - Implement automatic duplicate singleton hubloc removal + - Send author id, id_sig and key fields along with author/owner + - Implement custom redis session backend + - Improved registration workflow + - Complete rewrite of the registration backend with many new features + - Complete rewrite of the invite app + - Update Spanish, Russian and Polish translations + - Improved PHP8 compatibiliy (work in progress) + + Bugfixes + - Fix manual fetching of non-ascii domains + - Fix revision not compared when importing items + - Fix events not transformed to UTC when importing calendar + - Fix timezone issue in mod cal + - Fix profile photos not revalidated + - Fix regression in caldav/carddav discovery + - Fix caldav/carddav sync on remote access + - Fix info and notice messages not bootstraped when using SSE + - Fix URL including an @ treated like a webbie + - Fix cover photo image issues on some mobile devices + + Addons + - Diaspora: improve performance when delivering public items + - Diaspora: make sure to not process same contact more than once + - Pubcrawl: make sure to not process same contact more than once + - Pubcrawl: do not relay Like and Dislike activity + - Pubcrawl: deprecate as_follow() in favour of core Activity::follow() + - Pubcrawl: improved compatibility with mobilizon and xwiki + - Pubcrawl: do not process follow/unfollw thread in as_create_note() + - Diaspora: do not relay comments/likes of strangers if the thread-owner is local and does not allow comments/likes by strangers in the diaspora app settings + + Hubzilla 5.4.3 (2021-04-20) - Fix regression in mod notifications (only the last was visible) - Set Permissions-Policy: interest-cohort=() header by default diff --git a/Zotlabs/Module/Magic.php b/Zotlabs/Module/Magic.php index b4372e26d..bfd38d2fa 100644 --- a/Zotlabs/Module/Magic.php +++ b/Zotlabs/Module/Magic.php @@ -40,7 +40,7 @@ class Magic extends Controller { goaway($dest); } - $basepath = $parsed['scheme'] . '://' . $parsed['host'] . (($parsed['port']) ? ':' . $parsed['port'] : ''); + $basepath = $parsed['scheme'] . '://' . $parsed['host'] . (isset($parsed['port']) ? ':' . $parsed['port'] : ''); $owapath = SConfig::get($basepath,'system','openwebauth', $basepath . '/owa'); // This is ready-made for a plugin that provides a blacklist or "ask me" before blindly authenticating. @@ -110,6 +110,7 @@ class Magic extends Controller { $headers['(request-target)'] = 'post ' . '/owa'; $headers = HTTPSig::create_sig($headers,$channel['channel_prvkey'], channel_url($channel),true,'sha512'); + $redirects = 0; $x = z_post_url($owapath,$data,$redirects,[ 'headers' => $headers ]); logger('owa fetch returned: ' . print_r($x,true),LOGGER_DATA); if ($x['success']) { diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index 099289c03..e62accb06 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -876,7 +876,7 @@ class Photos extends \Zotlabs\Web\Controller { $prevlink = ''; $nextlink = ''; - if($_GET['order'] === 'posted') + if(isset($_GET['order']) && $_GET['order'] === 'posted') $order = 'ASC'; else $order = 'DESC'; @@ -901,8 +901,8 @@ class Photos extends \Zotlabs\Web\Controller { } } - $prevlink = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$prv]['hash'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); - $nextlink = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$nxt]['hash'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : ''); + $prevlink = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$prv]['hash'] . (($order == 'ASC') ? '?f=&order=posted' : ''); + $nextlink = z_root() . '/photos/' . \App::$data['channel']['channel_address'] . '/image/' . $prvnxt[$nxt]['hash'] . (($order == 'ASC') ? '?f=&order=posted' : ''); } @@ -987,7 +987,7 @@ class Photos extends \Zotlabs\Web\Controller { } $tags = array(); - if($link_item['term']) { + if(x($link_item, 'term')) { $cnt = 0; foreach($link_item['term'] as $t) { $tags[$cnt] = array(0 => format_term_for_display($t)); diff --git a/Zotlabs/Module/Sse.php b/Zotlabs/Module/Sse.php index 8bea65207..6f3df299f 100644 --- a/Zotlabs/Module/Sse.php +++ b/Zotlabs/Module/Sse.php @@ -108,7 +108,8 @@ class Sse extends Controller { echo 'data: {}'; echo "\n\n"; - ob_end_flush(); + if(ob_get_length() > 0) + ob_end_flush(); flush(); if(connection_status() != CONNECTION_NORMAL || connection_aborted()) { diff --git a/include/channel.php b/include/channel.php index bc9f686e7..804d8c63a 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1516,8 +1516,11 @@ function profile_load($nickname, $profile = '') { if($p[0]['keywords']) { $keywords = str_replace(array('#',',',' ',',,'),array('',' ',',',','),$p[0]['keywords']); - if(strlen($keywords) && $can_view_profile) + if(strlen($keywords) && $can_view_profile) { + if(! isset(App::$page['htmlhead'])) + App::$page['htmlhead'] = ''; App::$page['htmlhead'] .= '<meta name="keywords" content="' . htmlentities($keywords,ENT_COMPAT,'UTF-8') . '" />' . "\r\n" ; + } } App::$profile = $p[0]; diff --git a/include/feedutils.php b/include/feedutils.php index e827bde98..f489030b6 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -296,7 +296,7 @@ function get_atom_author($feed, $item) { $rawauthor = $item->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10,'author'); - if($rawauthor && $rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link']) { + if($rawauthor && isset($rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'])) { $base = $rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link']; foreach($base as $link) { if(!x($author, 'author_photo') || ! $author['author_photo']) { @@ -336,7 +336,7 @@ function get_atom_author($feed, $item) { if(! x($author,'author_link') || ! x($author,'author_photo')) { $rawauthor = $feed->get_feed_tags(SIMPLEPIE_NAMESPACE_ATOM_10,'author'); - if($rawauthor && $rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link']) { + if($rawauthor && isset($rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'])) { $base = $rawauthor[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link']; foreach($base as $link) { if($link['attribs']['']['rel'] === 'alternate' && (! $author['author_link'])) { @@ -372,16 +372,16 @@ function get_atom_author($feed, $item) { if(! $rawowner) $rawowner = $item->get_item_tags(NAMESPACE_ZOT, 'owner'); - if($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']) + if(isset($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) $author['owner_name'] = unxmlify($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']); - elseif($rawowner[0]['child'][NAMESPACE_DFRN]['name'][0]['data']) + elseif(isset($rawowner[0]['child'][NAMESPACE_DFRN]['name'][0]['data'])) $author['owner_name'] = unxmlify($rawowner[0]['child'][NAMESPACE_DFRN]['name'][0]['data']); - if($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']) + if(isset($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) $author['owner_link'] = unxmlify($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data']); - elseif($rawowner[0]['child'][NAMESPACE_DFRN]['uri'][0]['data']) + elseif(isset($rawowner[0]['child'][NAMESPACE_DFRN]['uri'][0]['data'])) $author['owner_link'] = unxmlify($rawowner[0]['child'][NAMESPACE_DFRN]['uri'][0]['data']); - if($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link']) { + if(isset($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link'])) { $base = $rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['link']; foreach($base as $link) { diff --git a/include/menu.php b/include/menu.php index 02b05a36e..1f65f987d 100644 --- a/include/menu.php +++ b/include/menu.php @@ -16,7 +16,7 @@ function menu_fetch($name,$uid,$observer_xchan) { ); if($r) { $x = q("select * from menu_item where mitem_menu_id = %d and mitem_channel_id = %d - $sql_options + $sql_options order by mitem_order asc, mitem_desc asc", intval($r[0]['menu_id']), intval($uid) @@ -26,7 +26,7 @@ function menu_fetch($name,$uid,$observer_xchan) { return null; } - + function menu_element($channel,$menu) { $arr = array(); @@ -67,7 +67,7 @@ function menu_element($channel,$menu) { } $arr['items'][] = $entry; } - } + } return $arr; } @@ -111,7 +111,7 @@ function menu_render($menu, $class='', $edit = false, $var = array()) { $menu['items'][$x]['mitem_desc'] = zidify_links(smilies(bbcode($menu['items'][$x]['mitem_desc']))); } - $wrap = (! x($var, 'wrap') || $var['wrap'] === 'none' ? false : true); + $wrap = ((isset($var['wrap']) && $var['wrap'] === 'none') ? false : true); $ret = replace_macros(get_markup_template('usermenu.tpl'),array( '$menu' => $menu['menu'], @@ -168,7 +168,7 @@ function menu_create($arr) { $t = datetime_convert(); - $r = q("insert into menu ( menu_name, menu_desc, menu_flags, menu_channel_id, menu_created, menu_edited ) + $r = q("insert into menu ( menu_name, menu_desc, menu_flags, menu_channel_id, menu_created, menu_edited ) values( '%s', '%s', %d, %d, '%s', '%s' )", dbesc($menu_name), dbesc($menu_desc), @@ -260,7 +260,7 @@ function menu_edit($arr) { } return q("update menu set menu_name = '%s', menu_desc = '%s', menu_flags = %d, menu_edited = '%s' - where menu_id = %d and menu_channel_id = %d", + where menu_id = %d and menu_channel_id = %d", dbesc($menu_name), dbesc($menu_desc), intval($menu_flags), @@ -295,7 +295,7 @@ function menu_delete_id($menu_id, $uid) { intval($menu_id), intval($uid) ); - } + } return false; } @@ -304,11 +304,11 @@ function menu_add_item($menu_id, $uid, $arr) { $mitem_link = escape_tags($arr['mitem_link']); $mitem_desc = escape_tags($arr['mitem_desc']); - $mitem_order = intval($arr['mitem_order']); + $mitem_order = intval($arr['mitem_order']); $mitem_flags = intval($arr['mitem_flags']); if(local_channel() == $uid) { - $channel = App::get_channel(); + $channel = App::get_channel(); } $acl = new Zotlabs\Access\AccessList($channel); @@ -344,12 +344,12 @@ function menu_edit_item($menu_id, $uid, $arr) { $mitem_id = intval($arr['mitem_id']); $mitem_link = escape_tags($arr['mitem_link']); $mitem_desc = escape_tags($arr['mitem_desc']); - $mitem_order = intval($arr['mitem_order']); + $mitem_order = intval($arr['mitem_order']); $mitem_flags = intval($arr['mitem_flags']); if(local_channel() == $uid) { - $channel = App::get_channel(); + $channel = App::get_channel(); } $acl = new Zotlabs\Access\AccessList($channel); @@ -403,7 +403,7 @@ function menu_sync_packet($uid,$observer_hash,$menu_id,$delete = false) { $r = menu_fetch_id($menu_id,$uid); $c = channelx_by_n($uid); if($r) { - $m = menu_fetch($r['menu_name'],$uid,$observer_hash); + $m = menu_fetch($r['menu_name'],$uid,$observer_hash); if($m) { if($delete) $m['menu_delete'] = 1; diff --git a/include/opengraph.php b/include/opengraph.php index 4c88570d3..465acbd39 100644 --- a/include/opengraph.php +++ b/include/opengraph.php @@ -62,6 +62,8 @@ $ogimagetype = $channel['xchan_photo_mimetype']; } + if (! isset(App::$page['htmlhead'])) + App::$page['htmlhead'] = ''; App::$page['htmlhead'] .= '<meta property="og:title" content="' . htmlspecialchars((isset($ogtitle) ? $ogtitle : $channel['channel_name'])) . '">' . "\r\n"; App::$page['htmlhead'] .= '<meta property="og:image" content="' . $ogimage . '">' . "\r\n"; App::$page['htmlhead'] .= '<meta property="og:image:type" content="' . $ogimagetype . '">' . "\r\n"; |