Update Nickname lexer

This commit is contained in:
Daniel Supernault 2018-04-29 10:26:58 -06:00
parent 0f6728bfe3
commit e96fa8ce72

View file

@ -6,6 +6,10 @@ class Nickname {
public static function normalizeProfileUrl($url)
{
if(starts_with($url, 'acct:')) {
$url = str_replace('acct:', '', $url);
}
if(!str_contains($url, '@') && filter_var($url, FILTER_VALIDATE_URL)) {
$parsed = parse_url($url);
$username = str_replace(['/','\\','@'], '', $parsed['path']);