X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=mod%2Flockview.php;h=48227cc1eaf47aa0d973e71a621f34e134f71ebf;hb=10ede7314136edb1c475e1af546a59ff4c5648cf;hp=0ae54c8c125f92d07616113a7b52865e3d61fed1;hpb=a12600587709b10cfdb674f6f428290e221ac6f3;p=friendica.git
diff --git a/mod/lockview.php b/mod/lockview.php
index 0ae54c8c12..48227cc1ea 100644
--- a/mod/lockview.php
+++ b/mod/lockview.php
@@ -1,8 +1,9 @@
argc > 1) ? $a->argv[1] : 0);
if (is_numeric($type)) {
$item_id = intval($type);
@@ -10,19 +11,20 @@ function lockview_content(&$a) {
} else {
$item_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
}
-
+
if(! $item_id)
killme();
if (!in_array($type, array('item','photo','event')))
killme();
-
+
$r = q("SELECT * FROM `%s` WHERE `id` = %d LIMIT 1",
dbesc($type),
intval($item_id)
);
- if(! count($r))
+ if (! dbm::is_result($r)) {
killme();
+ }
$item = $r[0];
call_hooks('lockview_content', $item);
@@ -33,7 +35,7 @@ function lockview_content(&$a) {
}
- if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
+ if(($item['private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid']))
&& (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) {
echo t('Remote privacy information not available.') . '
';
@@ -52,16 +54,16 @@ function lockview_content(&$a) {
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
dbesc(implode(', ', $allowed_groups))
);
- if(count($r))
- foreach($r as $rr)
+ if (dbm::is_result($r))
+ foreach($r as $rr)
$l[] = '' . $rr['name'] . '';
}
if(count($allowed_users)) {
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
dbesc(implode(', ',$allowed_users))
);
- if(count($r))
- foreach($r as $rr)
+ if (dbm::is_result($r))
+ foreach($r as $rr)
$l[] = $rr['name'];
}
@@ -70,16 +72,16 @@ function lockview_content(&$a) {
$r = q("SELECT `name` FROM `group` WHERE `id` IN ( %s )",
dbesc(implode(', ', $deny_groups))
);
- if(count($r))
- foreach($r as $rr)
+ if (dbm::is_result($r))
+ foreach($r as $rr)
$l[] = '' . $rr['name'] . '';
}
if(count($deny_users)) {
$r = q("SELECT `name` FROM `contact` WHERE `id` IN ( %s )",
dbesc(implode(', ',$deny_users))
);
- if(count($r))
- foreach($r as $rr)
+ if (dbm::is_result($r))
+ foreach($r as $rr)
$l[] = '' . $rr['name'] . '';
}