diff options
author | Andrew Dolgov <[email protected]> | 2021-02-22 14:41:09 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-22 14:41:09 +0300 |
commit | be4e7b13403666fc477d4b563ea8c075d0fd2022 (patch) | |
tree | 38eee4a6d7a5f0c4ecc3b37f997c385559c1d2a8 /plugins/af_redditimgur/init.php | |
parent | 043ef3dad68f774598e1b172ecb0f5ea75f112af (diff) |
fix several issues reported by phpstan
Diffstat (limited to 'plugins/af_redditimgur/init.php')
-rwxr-xr-x | plugins/af_redditimgur/init.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index 2677fdd90..713eaea5c 100755 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -207,7 +207,7 @@ class Af_RedditImgur extends Plugin { $found = false; // embed before reddit <table> post layout - $anchor = $xpath->query('//body/*')->item(0); + $anchor = $xpath->query('//_body/*')->item(0); // deal with json-provided media content first if ($article["link"] && $anchor) { @@ -217,6 +217,7 @@ class Af_RedditImgur extends Plugin { $this->fallback_preview_urls = []; + // @phpstan-ignore-next-line if ($tmp && $anchor) { $json = json_decode($tmp, true); @@ -346,6 +347,8 @@ class Af_RedditImgur extends Plugin { if (strpos($source_stream, "imgur.com") !== false) $poster_url = str_replace(".mp4", "h.jpg", $source_stream); + else + $poster_url = false; $this->handle_as_video($doc, $entry, $source_stream, $poster_url); |