From 7daf009a7fae98281c241723f2924bede0d6620d Mon Sep 17 00:00:00 2001 From: Rodney Stromlund Date: Tue, 12 Mar 2019 12:16:24 -0500 Subject: [PATCH] Add set_basic_feed_info hook to af_comics to fix GoComics title and url. --- plugins/af_comics/init.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/af_comics/init.php b/plugins/af_comics/init.php index a46933305..d24287c74 100755 --- a/plugins/af_comics/init.php +++ b/plugins/af_comics/init.php @@ -14,6 +14,7 @@ class Af_Comics extends Plugin { $this->host = $host; $host->add_hook($host::HOOK_FETCH_FEED, $this); + $host->add_hook($host::HOOK_FEED_BASIC_INFO, $this); $host->add_hook($host::HOOK_SUBSCRIBE_FEED, $this); $host->add_hook($host::HOOK_ARTICLE_FILTER, $this); $host->add_hook($host::HOOK_PREFS_TAB, $this); @@ -166,6 +167,16 @@ class Af_Comics extends Plugin { return $contents; } + function hook_feed_basic_info($basic_info, $fetch_url, $owner_uid, $feed, $auth_login, $auth_pass) { + if ($auth_login || $auth_pass) + return $basic_info; + + if (preg_match('#^https?://www\.gocomics\.com/([-a-z0-9]+)$#i', $fetch_url, $matches)) + $basic_info = array('title' => ucfirst($matches[1]), 'site_url' => $matches[0]); + + return $basic_info; + } + function api_version() { return 2; }