mirror of
https://github.com/shlinkio/shlink.git
synced 2024-11-25 18:30:23 -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();
|
||||
preg_match('/<title>(.+)<\/title>/i', $body, $matches);
|
||||
preg_match('/<title[^>]*>(.*?)<\/title>/i', $body, $matches);
|
||||
return $matches[1] ?? null;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user