mirror of
https://github.com/Kovah/LinkAce.git
synced 2025-04-21 23:42:10 +02:00
Update regex to correctly check for youtube links (#263)
This commit is contained in:
parent
b4cc711b5a
commit
cf986ba80f
@ -114,7 +114,7 @@ class HtmlMeta
|
||||
*/
|
||||
if (is_null($thumbnail)) {
|
||||
if (str_contains($this->url, 'youtube.com') && str_contains($this->url, 'v=')) {
|
||||
preg_match('/v=([a-zA-Z0-9]+)/', $this->url, $matched);
|
||||
preg_match('/v=([a-zA-Z0-9_]+)/', $this->url, $matched);
|
||||
$thumbnail = isset($matched[1]) ? 'https://img.youtube.com/vi/' . $matched[1] . '/mqdefault.jpg' : null;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user