1
0
Fork 0

Now without array_merge

This commit is contained in:
Michael 2019-07-01 22:14:34 +00:00
parent 9e3aff9ade
commit ee8baf00ce
2 changed files with 2 additions and 2 deletions

View file

@ -1587,7 +1587,7 @@ class Contact extends BaseObject
return ''; return '';
} }
if (in_array($contact["network"], array_merge(Protocol::FEDERATED ,['']))) { if (empty($contact["network"]) || in_array($contact["network"], Protocol::FEDERATED)) {
$sql = "(`item`.`uid` = 0 OR (`item`.`uid` = ? AND NOT `item`.`global`))"; $sql = "(`item`.`uid` = 0 OR (`item`.`uid` = ? AND NOT `item`.`global`))";
} else { } else {
$sql = "`item`.`uid` = ?"; $sql = "`item`.`uid` = ?";

View file

@ -1354,7 +1354,7 @@ class Item extends BaseObject
* We have to check several networks since Friendica posts could be repeated * We have to check several networks since Friendica posts could be repeated
* via OStatus (maybe Diasporsa as well) * via OStatus (maybe Diasporsa as well)
*/ */
if (in_array($item['network'], array_merge(Protocol::FEDERATED ,['']))) { if (empty($item['network']) || in_array($item['network'], Protocol::FEDERATED)) {
$condition = ["`uri` = ? AND `uid` = ? AND `network` IN (?, ?, ?)", $condition = ["`uri` = ? AND `uid` = ? AND `network` IN (?, ?, ?)",
trim($item['uri']), $item['uid'], trim($item['uri']), $item['uid'],
Protocol::DIASPORA, Protocol::DFRN, Protocol::OSTATUS]; Protocol::DIASPORA, Protocol::DFRN, Protocol::OSTATUS];