Merge pull request #6792 from MrPetovan/bug/warnings
Fix allow_cid variable type in mod/network
This commit is contained in:
commit
df04bd9dbe
|
@ -539,20 +539,28 @@ function networkThreadedView(App $a, $update, $parent)
|
||||||
$order = Strings::escapeTags(defaults($_GET, 'order', 'comment'));
|
$order = Strings::escapeTags(defaults($_GET, 'order', 'comment'));
|
||||||
$nets = defaults($_GET, 'nets' , '');
|
$nets = defaults($_GET, 'nets' , '');
|
||||||
|
|
||||||
|
$allowedCids = [];
|
||||||
if ($cid) {
|
if ($cid) {
|
||||||
$default_permissions['allow_cid'] = [(int) $cid];
|
$allowedCids[] = (int) $cid;
|
||||||
|
} elseif ($nets) {
|
||||||
|
$condition = [
|
||||||
|
'uid' => local_user(),
|
||||||
|
'network' => $nets,
|
||||||
|
'self' => false,
|
||||||
|
'blocked' => false,
|
||||||
|
'pending' => false,
|
||||||
|
'archive' => false,
|
||||||
|
'rel' => [Contact::SHARING, Contact::FRIEND],
|
||||||
|
];
|
||||||
|
$contactStmt = DBA::select('contact', ['id'], $condition);
|
||||||
|
while ($contact = DBA::fetch($contactStmt)) {
|
||||||
|
$allowedCids[] = (int) $contact['id'];
|
||||||
|
}
|
||||||
|
DBA::close($contactStmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($nets) {
|
if (count($allowedCids)) {
|
||||||
$r = DBA::select('contact', ['id'], ['uid' => local_user(), 'network' => $nets], ['self' => false]);
|
$default_permissions['allow_cid'] = $allowedCids;
|
||||||
|
|
||||||
$str = [];
|
|
||||||
while ($rr = DBA::fetch($r)) {
|
|
||||||
$str[] = (int) $rr['id'];
|
|
||||||
}
|
|
||||||
if (strlen($str)) {
|
|
||||||
$default_permissions['allow_cid'] = $str;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$update && !$rawmode) {
|
if (!$update && !$rawmode) {
|
||||||
|
|
Loading…
Reference in a new issue