summaryrefslogtreecommitdiff
path: root/plugins/af_redditimgur
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-07-09 15:34:28 +0300
committerAndrew Dolgov <[email protected]>2015-07-09 15:34:28 +0300
commit9ec9a8f941427573f36fd686e3c291104ec89b85 (patch)
tree3dc2861a38cf71c5e227029ec53ff0a90c3d4a26 /plugins/af_redditimgur
parent12d880d77a166e87aebe49b17e0247c06cec6024 (diff)
redditimgur: don't try to readability parse youtube, add another youtube embed variant
Diffstat (limited to 'plugins/af_redditimgur')
-rw-r--r--plugins/af_redditimgur/init.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php
index 820c45d67..1091f3088 100644
--- a/plugins/af_redditimgur/init.php
+++ b/plugins/af_redditimgur/init.php
@@ -115,6 +115,7 @@ class Af_RedditImgur extends Plugin {
$matches = array();
if (preg_match("/\.youtube\.com\/v\/([\w-]+)/", $entry->getAttribute("href"), $matches) ||
+ 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)) {
@@ -249,6 +250,7 @@ class Af_RedditImgur extends Plugin {
if ($content_link &&
strpos($content_link->getAttribute("href"), "twitter.com") === FALSE &&
+ strpos($content_link->getAttribute("href"), "youtube.com") === FALSE &&
strpos($content_link->getAttribute("href"), "reddit.com") === FALSE) {
/* link may lead to a huge video file or whatever, we need to check content type before trying to