mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update Nickname lexer
This commit is contained in:
parent
0f6728bfe3
commit
e96fa8ce72
1 changed files with 4 additions and 0 deletions
|
@ -6,6 +6,10 @@ class Nickname {
|
||||||
|
|
||||||
public static function normalizeProfileUrl($url)
|
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)) {
|
if(!str_contains($url, '@') && filter_var($url, FILTER_VALIDATE_URL)) {
|
||||||
$parsed = parse_url($url);
|
$parsed = parse_url($url);
|
||||||
$username = str_replace(['/','\\','@'], '', $parsed['path']);
|
$username = str_replace(['/','\\','@'], '', $parsed['path']);
|
||||||
|
|
Loading…
Reference in a new issue