summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-05-07 07:42:24 +0300
committerAndrew Dolgov <[email protected]>2021-05-07 07:42:24 +0300
commitfea59de26b57a8922de1288d15c34968a75e39f4 (patch)
tree6e668002e143c6230c8e53c2cc50d8df1d060ad1 /plugins
parent86300a0ca85f3133f7a5f0d1bc9ad5d99a8b680d (diff)
af_redditimgur: use core youtube vid helper
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/af_redditimgur/init.php8
1 files changed, 1 insertions, 7 deletions
diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php
index b16b679af..3b4094b1b 100755
--- a/plugins/af_redditimgur/init.php
+++ b/plugins/af_redditimgur/init.php
@@ -425,13 +425,7 @@ class Af_RedditImgur extends Plugin {
}
$matches = array();
- if (!$found && (preg_match("/youtube\.com\/v\/([\w-]+)/", $entry_href, $matches) ||
- preg_match("/youtube\.com\/.*?[\&\?]v=([\w-]+)/", $entry_href, $matches) ||
- preg_match("/youtube\.com\/embed\/([\w-]+)/", $entry_href, $matches) ||
- preg_match("/youtube\.com\/watch\?v=([\w-]+)/", $entry_href, $matches) ||
- preg_match("/\/\/youtu.be\/([\w-]+)/", $entry_href, $matches))) {
-
- $vid_id = $matches[1];
+ if (!$found && $vid_id = UrlHelper::url_to_youtube_vid($entry_href)) {
Debug::log("Handling as youtube: $vid_id", Debug::LOG_VERBOSE);