diff options
| author | wn_ <invalid@email.com> | 2024-11-12 03:49:58 +0000 |
|---|---|---|
| committer | wn_ <invalid@email.com> | 2024-11-12 03:49:58 +0000 |
| commit | 5a200755b8afd8e719214f19b51a38dc8870fe09 (patch) | |
| tree | 08c0f14ca1880b64a0e32fdf0eebfebd1314f09e /classes/PluginHost.php | |
| parent | dca2ae60a1c7a7951ee769aefeb19c4576c57aa6 (diff) | |
Move 'IVirtualFeed' checks into 'PluginHost::get_feed_handler()'.
Diffstat (limited to 'classes/PluginHost.php')
| -rw-r--r-- | classes/PluginHost.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/classes/PluginHost.php b/classes/PluginHost.php index b54e48d4f..608355158 100644 --- a/classes/PluginHost.php +++ b/classes/PluginHost.php @@ -782,12 +782,21 @@ class PluginHost { return $this->feeds[$cat_id] ?? []; } - // convert feed_id (e.g. -129) to pfeed_id first + /** + * convert feed_id (e.g. -129) to pfeed_id first + * + * @return (Plugin&IVirtualFeed)|null + */ function get_feed_handler(int $pfeed_id): ?Plugin { foreach ($this->feeds as $cat) { foreach ($cat as $feed) { if ($feed['id'] == $pfeed_id) { - return $feed['sender']; + if (implements_interface($feed['sender'], 'IVirtualFeed')) { + /** @var Plugin&IVirtualFeed $feed['sender'] */ + return $feed['sender']; + } else { + return null; + } } } } |