mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Fixed regex to parse title from URL to consider possible attributes
This commit is contained in:
parent
8b54098299
commit
71f85350da
@ -51,7 +51,7 @@ class UrlValidator implements UrlValidatorInterface, RequestMethodInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$body = $response->getBody()->__toString();
|
$body = $response->getBody()->__toString();
|
||||||
preg_match('/<title>(.+)<\/title>/i', $body, $matches);
|
preg_match('/<title[^>]*>(.*?)<\/title>/i', $body, $matches);
|
||||||
return $matches[1] ?? null;
|
return $matches[1] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user