mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:15:13 +00:00
case-sensitivity in find_xchan_in_array()
This commit is contained in:
parent
afe23fbbc7
commit
0e6e12305e
3 changed files with 3 additions and 30 deletions
|
@ -4790,7 +4790,7 @@ function list_attached_local_files($body) {
|
||||||
function fix_attached_permissions($uid,$body,$str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny,$token = EMPTY_STR) {
|
function fix_attached_permissions($uid,$body,$str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny,$token = EMPTY_STR) {
|
||||||
|
|
||||||
$channel = Channel::from_id($uid);
|
$channel = Channel::from_id($uid);
|
||||||
|
|
||||||
$files = list_attached_local_files($body);
|
$files = list_attached_local_files($body);
|
||||||
if (! $files) {
|
if (! $files) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -2739,35 +2739,11 @@ function xchan_query(&$items, $abook = true, $effective_uid = 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function xchan_mail_query(&$item)
|
|
||||||
{
|
|
||||||
$arr = [];
|
|
||||||
$chans = null;
|
|
||||||
if ($item) {
|
|
||||||
if ($item['from_xchan'] && (! in_array("'" . dbesc($item['from_xchan']) . "'", $arr))) {
|
|
||||||
$arr[] = "'" . dbesc($item['from_xchan']) . "'";
|
|
||||||
}
|
|
||||||
if ($item['to_xchan'] && (! in_array("'" . dbesc($item['to_xchan']) . "'", $arr))) {
|
|
||||||
$arr[] = "'" . dbesc($item['to_xchan']) . "'";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count($arr)) {
|
|
||||||
$chans = q("select xchan.*,hubloc.* from xchan left join hubloc on hubloc_hash = xchan_hash
|
|
||||||
where xchan_hash in (" . protect_sprintf(implode(',', $arr)) . ") and hubloc_primary = 1 and hubloc_deleted = 0");
|
|
||||||
}
|
|
||||||
if ($chans) {
|
|
||||||
$item['from'] = find_xchan_in_array($item['from_xchan'], $chans);
|
|
||||||
$item['to'] = find_xchan_in_array($item['to_xchan'], $chans);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function find_xchan_in_array($xchan, $arr)
|
function find_xchan_in_array($xchan, $arr)
|
||||||
{
|
{
|
||||||
if (count($arr)) {
|
if (count($arr)) {
|
||||||
foreach ($arr as $x) {
|
foreach ($arr as $x) {
|
||||||
if ($x['xchan_hash'] === $xchan) {
|
if (strtolower($x['xchan_hash']) === strtolower($xchan)) {
|
||||||
return $x;
|
return $x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,10 +26,7 @@ class Poller implements DaemonInterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$interval = intval(get_config('system', 'poll_interval'));
|
$interval = intval(get_config('system', 'poll_interval', 3));
|
||||||
if (! $interval) {
|
|
||||||
$interval = ((get_config('system', 'delivery_interval') === false) ? 3 : intval(get_config('system', 'delivery_interval')));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check for a lockfile. If it exists, but is over an hour old, it's stale. Ignore it.
|
// Check for a lockfile. If it exists, but is over an hour old, it's stale. Ignore it.
|
||||||
$lockfile = 'cache/poller';
|
$lockfile = 'cache/poller';
|
||||||
|
|
Loading…
Reference in a new issue