mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 12:13:13 +08:00
Fixed regex to parse title from URL to consider possible attributes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user