1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-16 13:34:11 +02:00

fix: php errors (notices) (#3115)

This commit is contained in:
Dag
2022-10-26 00:47:45 +02:00
committed by GitHub
parent 8795cb252f
commit 52af2ae34c
9 changed files with 33 additions and 20 deletions

View File

@@ -150,8 +150,6 @@ class RedditBridge extends BridgeAbstract
$flair = '';
}
foreach ($subreddits as $subreddit) {
$name = trim($subreddit);
$values = getContents(self::URI
@@ -207,14 +205,17 @@ class RedditBridge extends BridgeAbstract
$item['content']
= htmlspecialchars_decode($data->selftext_html);
} elseif (isset($data->post_hint) ? $data->post_hint == 'link' : false) {
} elseif (isset($data->post_hint) && $data->post_hint == 'link') {
// Link with preview
if (isset($data->media)) {
// Reddit embeds content for some sites (e.g. Twitter)
$embed = htmlspecialchars_decode(
$data->media->oembed->html
);
// todo: maybe switch on the type
if (isset($data->media->oembed->html)) {
// Reddit embeds content for some sites (e.g. Twitter)
$embed = htmlspecialchars_decode($data->media->oembed->html);
} else {
$embed = '';
}
} else {
$embed = '';
}