Improve contact search speed / assume octet-stream on missing content type
This commit is contained in:
parent
3395c61649
commit
c5337c81e7
2 changed files with 5 additions and 4 deletions
|
@ -110,7 +110,7 @@ class Acl extends BaseModule
|
||||||
$search = $_REQUEST['query'];
|
$search = $_REQUEST['query'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger::info('ACL {action} - {subaction}', ['module' => 'acl', 'action' => 'content', 'subaction' => 'search', 'search' => $search, 'type' => $type, 'conversation' => $conv_id]);
|
Logger::info('ACL {action} - {subaction} - start', ['module' => 'acl', 'action' => 'content', 'subaction' => 'search', 'search' => $search, 'type' => $type, 'conversation' => $conv_id]);
|
||||||
|
|
||||||
$sql_extra = '';
|
$sql_extra = '';
|
||||||
$condition = ["`uid` = ? AND NOT `deleted` AND NOT `pending` AND NOT `archive`", local_user()];
|
$condition = ["`uid` = ? AND NOT `deleted` AND NOT `pending` AND NOT `archive`", local_user()];
|
||||||
|
@ -207,7 +207,7 @@ class Acl extends BaseModule
|
||||||
foreach ($r as $g) {
|
foreach ($r as $g) {
|
||||||
$entry = [
|
$entry = [
|
||||||
'type' => 'c',
|
'type' => 'c',
|
||||||
'photo' => Contact::getMicro($g),
|
'photo' => Contact::getMicro($g, true),
|
||||||
'name' => htmlspecialchars($g['name']),
|
'name' => htmlspecialchars($g['name']),
|
||||||
'id' => intval($g['id']),
|
'id' => intval($g['id']),
|
||||||
'network' => $g['network'],
|
'network' => $g['network'],
|
||||||
|
@ -268,7 +268,7 @@ class Acl extends BaseModule
|
||||||
if (count($contact) > 0) {
|
if (count($contact) > 0) {
|
||||||
$unknown_contacts[] = [
|
$unknown_contacts[] = [
|
||||||
'type' => 'c',
|
'type' => 'c',
|
||||||
'photo' => Contact::getMicro($contact),
|
'photo' => Contact::getMicro($contact, true),
|
||||||
'name' => htmlspecialchars($contact['name']),
|
'name' => htmlspecialchars($contact['name']),
|
||||||
'id' => intval($contact['id']),
|
'id' => intval($contact['id']),
|
||||||
'network' => $contact['network'],
|
'network' => $contact['network'],
|
||||||
|
@ -304,6 +304,7 @@ class Acl extends BaseModule
|
||||||
'items' => $results['items'],
|
'items' => $results['items'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Logger::info('ACL {action} - {subaction} - done', ['module' => 'acl', 'action' => 'content', 'subaction' => 'search', 'search' => $search, 'type' => $type, 'conversation' => $conv_id]);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,7 @@ class ParseUrl
|
||||||
|
|
||||||
$contenttype = $curlResult->getHeader('Content-Type')[0] ?? '';
|
$contenttype = $curlResult->getHeader('Content-Type')[0] ?? '';
|
||||||
if (empty($contenttype)) {
|
if (empty($contenttype)) {
|
||||||
return [];
|
return ['application', 'octet-stream'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return explode('/', current(explode(';', $contenttype)));
|
return explode('/', current(explode(';', $contenttype)));
|
||||||
|
|
Loading…
Reference in a new issue