Merge pull request #10323 from annando/issue-10306

Issue 10306: Improve local delivery
This commit is contained in:
Hypolite Petovan 2021-05-26 14:24:24 -04:00 committed by GitHub
commit 8c99d3acc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 130 additions and 100 deletions

View file

@ -548,4 +548,15 @@ class Network
exit;
}
}
/**
* Check if the given URL is a local link
*
* @param string $url
* @return bool
*/
public static function isLocalLink(string $url)
{
return (strpos(Strings::normaliseLink($url), Strings::normaliseLink(DI::baseUrl())) !== false);
}
}