mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-28 05:58:40 -04:00
The GET branch of feedController::addAction() built a FreshRSS_Feed straight from the requested URL and loaded it, without invoking the Minz_HookType::CheckUrlBeforeAdd hook. Only the POST branch, through addFeed(), ran the hook. Extensions that turn a website URL into a feed URL (e.g. RSS-Bridge) were therefore bypassed on the confirmation page reached from the bookmarklet: the raw website URL was probed, and since such sites do not advertise a feed, the preview reported that no feed could be added. Submitting the very same form then succeeded, because the POST path did apply the hook. Run the hook at the start of the GET branch so the preview probes the URL that would actually be subscribed to, and reuse the existing "not added" feedback when an extension refuses the URL, matching what addFeed() does when the hook returns null. The documented contract is that the hook "will be executed every time a URL is added", so the preview should not be an exception. Fixes #9339