summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorkoffieanon <[email protected]>2020-01-04 17:21:05 +0100
committerkoffieanon <[email protected]>2020-01-04 17:21:05 +0100
commite89dd83f05c6307686bae0a689028c6aba8e87a0 (patch)
treef118966837e18661f5f362b4ac1ea531a9548f77 /plugins
parent297a89c2d220860f08e0c30356adfefe2cfa22cd (diff)
Spaces to tabs for consistency.
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/af_redditimgur/init.php42
1 files changed, 21 insertions, 21 deletions
diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php
index 555cb0710..6db194106 100755
--- a/plugins/af_redditimgur/init.php
+++ b/plugins/af_redditimgur/init.php
@@ -280,36 +280,36 @@ class Af_RedditImgur extends Plugin {
$found = true;
}
- // imgur via link rel="image_src" href="..."
- if (!$found && preg_match("/imgur/", $entry->getAttribute("href"))) {
+ // imgur via link rel="image_src" href="..."
+ if (!$found && preg_match("/imgur/", $entry->getAttribute("href"))) {
- Debug::log("handling as imgur page/whatever", Debug::$LOG_VERBOSE);
+ Debug::log("handling as imgur page/whatever", Debug::$LOG_VERBOSE);
- $content = fetch_file_contents(["url" => $entry->getAttribute("href"),
- "http_accept" => "text/*"]);
+ $content = fetch_file_contents(["url" => $entry->getAttribute("href"),
+ "http_accept" => "text/*"]);
- if ($content) {
- $cdoc = new DOMDocument();
+ if ($content) {
+ $cdoc = new DOMDocument();
- if (@$cdoc->loadHTML($content)) {
- $cxpath = new DOMXPath($cdoc);
+ if (@$cdoc->loadHTML($content)) {
+ $cxpath = new DOMXPath($cdoc);
- $rel_image = $cxpath->query("//link[@rel='image_src']")->item(0);
+ $rel_image = $cxpath->query("//link[@rel='image_src']")->item(0);
- if ($rel_image) {
+ if ($rel_image) {
- $img = $doc->createElement('img');
- $img->setAttribute("src", $rel_image->getAttribute("href"));
+ $img = $doc->createElement('img');
+ $img->setAttribute("src", $rel_image->getAttribute("href"));
- $br = $doc->createElement('br');
- $entry->parentNode->insertBefore($img, $entry);
- $entry->parentNode->insertBefore($br, $entry);
+ $br = $doc->createElement('br');
+ $entry->parentNode->insertBefore($img, $entry);
+ $entry->parentNode->insertBefore($br, $entry);
- $found = true;
- }
- }
- }
- }
+ $found = true;
+ }
+ }
+ }
+ }
// wtf is this even
if (!$found && preg_match("/^https?:\/\/gyazo\.com\/([^\.\/]+$)/", $entry->getAttribute("href"), $matches)) {