mirror of
https://github.com/friendica/friendica
synced 2025-04-26 13:50:11 +00:00
Avoid locally probing last item via network
This commit is contained in:
parent
29494ea721
commit
eb95314aaa
2 changed files with 13 additions and 0 deletions
|
@ -164,6 +164,11 @@ class User
|
|||
*/
|
||||
public static function getIdForURL(string $url)
|
||||
{
|
||||
// Avoid any database requests when the hostname isn't even part of the url.
|
||||
if (!strpos($url, DI::baseUrl()->getHostname())) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$self = Contact::selectFirst(['uid'], ['self' => true, 'nurl' => Strings::normaliseLink($url)]);
|
||||
if (!empty($self['uid'])) {
|
||||
return $self['uid'];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue