summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorkoffieanon <[email protected]>2020-01-04 17:20:33 +0100
committerkoffieanon <[email protected]>2020-01-04 17:20:33 +0100
commit297a89c2d220860f08e0c30356adfefe2cfa22cd (patch)
tree3aa1a62ca7e3ccaa41a3f75d835701c495055e35 /plugins
parent5448a9462e4c8ce6194d0a6dceeef4e422386c55 (diff)
Fix bug processing found due to operator precedence.
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/af_redditimgur/init.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php
index c8ba4a1b2..555cb0710 100755
--- a/plugins/af_redditimgur/init.php
+++ b/plugins/af_redditimgur/init.php
@@ -239,10 +239,10 @@ class Af_RedditImgur extends Plugin {
}
$matches = array();
- if (!$found && preg_match("/youtube\.com\/v\/([\w-]+)/", $entry->getAttribute("href"), $matches) ||
+ if (!$found && (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)) {
+ preg_match("/\/\/youtu.be\/([\w-]+)/", $entry->getAttribute("href"), $matches))) {
$vid_id = $matches[1];
@@ -264,9 +264,9 @@ class Af_RedditImgur extends Plugin {
$found = true;
}
- if (!$found && preg_match("/\.(jpg|jpeg|gif|png)(\?[0-9][0-9]*)?$/i", $entry->getAttribute("href")) ||
+ if (!$found && (preg_match("/\.(jpg|jpeg|gif|png)(\?[0-9][0-9]*)?$/i", $entry->getAttribute("href")) ||
mb_strpos($entry->getAttribute("href"), "i.reddituploads.com") !== FALSE ||
- mb_strpos($this->get_content_type($entry->getAttribute("href")), "image/") !== FALSE) {
+ mb_strpos($this->get_content_type($entry->getAttribute("href")), "image/") !== FALSE)) {
Debug::log("Handling as a picture", Debug::$LOG_VERBOSE);