From 4706ff693843e0fd059bba5d306a172f059b4af7 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 3 Feb 2019 14:52:50 +0100 Subject: do not overwrite $sql_extra --- Zotlabs/Module/Oep.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Module/Oep.php') diff --git a/Zotlabs/Module/Oep.php b/Zotlabs/Module/Oep.php index 0f20a5f9a..491a48f28 100644 --- a/Zotlabs/Module/Oep.php +++ b/Zotlabs/Module/Oep.php @@ -181,7 +181,7 @@ class Oep extends \Zotlabs\Web\Controller { dbesc($res) ); if($r) { - $sql_extra = "and item.id = " . intval($r[0]['iid']) . " "; + $sql_extra .= " and item.id = " . intval($r[0]['iid']) . " "; } else { return $ret; @@ -255,6 +255,8 @@ class Oep extends \Zotlabs\Web\Controller { if(! $channel) return $ret; +hz_syslog($nick); + if(! perm_is_allowed($channel['channel_id'],get_observer_hash(),'view_pages')) return $ret; @@ -265,7 +267,7 @@ class Oep extends \Zotlabs\Web\Controller { dbesc($res) ); if($r) { - $sql_extra = "and item.id = " . intval($r[0]['iid']) . " "; + $sql_extra .= " and item.id = " . intval($r[0]['iid']) . " "; } else { return $ret; -- cgit v1.2.3 From c657d766cf0dbca750840a4395003ea9e94a4809 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sun, 3 Feb 2019 14:58:19 +0100 Subject: cleanup logging and return if query returns empty result --- Zotlabs/Module/Oep.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module/Oep.php') diff --git a/Zotlabs/Module/Oep.php b/Zotlabs/Module/Oep.php index 491a48f28..c0d8e15e5 100644 --- a/Zotlabs/Module/Oep.php +++ b/Zotlabs/Module/Oep.php @@ -194,6 +194,9 @@ class Oep extends \Zotlabs\Web\Controller { intval(ITEM_TYPE_CARD) ); + if(! $r) + return; + $item_normal = " and item.item_hidden = 0 and item.item_type in (0,6) and item.item_deleted = 0 and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0 and item.item_blocked = 0 "; @@ -255,9 +258,6 @@ class Oep extends \Zotlabs\Web\Controller { if(! $channel) return $ret; -hz_syslog($nick); - - if(! perm_is_allowed($channel['channel_id'],get_observer_hash(),'view_pages')) return $ret; @@ -280,6 +280,9 @@ hz_syslog($nick); intval(ITEM_TYPE_ARTICLE) ); + if(! $r) + return; + $item_normal = " and item.item_hidden = 0 and item.item_type in (0,7) and item.item_deleted = 0 and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0 and item.item_blocked = 0 "; -- cgit v1.2.3