From f7745af9525b2d35b5cb0891452f3cbeeea56734 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 7 Jul 2015 14:21:13 +0300 Subject: [PATCH] af_redditimgur: improve youtube detection a bit --- plugins/af_redditimgur/init.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index 265999e2..3b37c0a7 100644 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -114,8 +114,8 @@ class Af_RedditImgur extends Plugin { } $matches = array(); - if (preg_match("/\/\/www\.youtube\.com\/v\/([\w-]+)/", $entry->getAttribute("href"), $matches) || - preg_match("/\/\/www\.youtube\.com\/watch\?v=([\w-]+)/", $entry->getAttribute("href"), $matches) || + if (preg_match("/\.youtube\.com\/v\/([\w-]+)/", $entry->getAttribute("href"), $matches) || + preg_match("/\.youtube\.com\/watch\?v=([\w-]+)/", $entry->getAttribute("href"), $matches) || preg_match("/\/\/youtu.be\/([\w-]+)/", $entry->getAttribute("href"), $matches)) { $vid_id = $matches[1]; -- 2.39.5