aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/channel.php5
-rw-r--r--include/feedutils.php14
-rw-r--r--include/menu.php24
-rw-r--r--include/opengraph.php2
4 files changed, 25 insertions, 20 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/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";