aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-05-14 08:56:07 +0000
committerMario <mario@mariovavti.com>2021-05-14 08:56:07 +0000
commit635a24dff477548bdcf601874cb1ff2509aef3cc (patch)
treebc14a1800d978e0f924b0c25ef7f7a3b69887ba5 /include
parentded9f18b8a36cae8dfe1797b7ba87d7742c996df (diff)
parenta03423794a1a9dc15588d40684fee3bf9a57b629 (diff)
downloadvolse-hubzilla-635a24dff477548bdcf601874cb1ff2509aef3cc.tar.gz
volse-hubzilla-635a24dff477548bdcf601874cb1ff2509aef3cc.tar.bz2
volse-hubzilla-635a24dff477548bdcf601874cb1ff2509aef3cc.zip
Merge branch 'dev' into 'dev'
Random PHP 8 fixes See merge request hubzilla/core!1951
Diffstat (limited to 'include')
-rw-r--r--include/channel.php5
-rw-r--r--include/feedutils.php14
-rw-r--r--include/opengraph.php2
3 files changed, 13 insertions, 8 deletions
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/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";