aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2016-01-30 12:05:49 +0100
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2016-01-30 12:05:49 +0100
commit76484f154124ccade9efd3a6b704692112a97477 (patch)
tree51919a98826ee650dd9f04d111527a494810d29b /include
parent9abff11f86b70b22d5a95105b8c54755f536ac0d (diff)
parentb6543beca2f0e5e353b497099e3fa6b29bf47233 (diff)
downloadvolse-hubzilla-76484f154124ccade9efd3a6b704692112a97477.tar.gz
volse-hubzilla-76484f154124ccade9efd3a6b704692112a97477.tar.bz2
volse-hubzilla-76484f154124ccade9efd3a6b704692112a97477.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include')
-rw-r--r--include/identity.php7
-rw-r--r--include/widgets.php20
2 files changed, 19 insertions, 8 deletions
diff --git a/include/identity.php b/include/identity.php
index fd0b4d7f5..e1e79394a 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -924,6 +924,10 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) {
$pdesc = true;
$reddress = true;
+ if(! perm_is_allowed($profile['uid'],((is_array($observer)) ? $observer['xchan_hash'] : ''),'view_profile')) {
+ $block = true;
+ }
+
if($block && intval(get_config('system','block_public_blackout')))
return $o;
@@ -1012,9 +1016,6 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) {
// logger('online: ' . $profile['online']);
- if(! perm_is_allowed($profile['uid'],((is_array($observer)) ? $observer['xchan_hash'] : ''),'view_profile')) {
- $block = true;
- }
if(($profile['hidewall'] && (! local_channel()) && (! remote_channel())) || $block ) {
$location = $reddress = $pdesc = $gender = $marital = $homepage = False;
diff --git a/include/widgets.php b/include/widgets.php
index 891e9c018..7e502e4c2 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -817,7 +817,7 @@ function widget_item($arr) {
return '';
- if(! $arr['mid'])
+ if((! $arr['mid']) && (! $arr['title']))
return '';
if(! perm_is_allowed($channel_id, get_observer_hash(), 'view_pages'))
@@ -826,10 +826,20 @@ function widget_item($arr) {
require_once('include/security.php');
$sql_extra = item_permissions_sql($channel_id);
- $r = q("select * from item where mid = '%s' and uid = %d and item_type = " . intval(ITEM_TYPE_WEBPAGE) . " $sql_extra limit 1",
- dbesc($arr['mid']),
- intval($channel_id)
- );
+ if($arr['title']) {
+ $r = q("select item.* from item left join item_id on item.id = item_id.iid
+ where item.uid = %d and sid = '%s' and service = 'WEBPAGE' and item_type = %d $sql_options $revision limit 1",
+ intval($channel_id),
+ dbesc($arr['title']),
+ intval(ITEM_TYPE_WEBPAGE)
+ );
+ }
+ else {
+ $r = q("select * from item where mid = '%s' and uid = %d and item_type = " . intval(ITEM_TYPE_WEBPAGE) . " $sql_extra limit 1",
+ dbesc($arr['mid']),
+ intval($channel_id)
+ );
+ }
if(! $r)
return '';