aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/subscriptionController.php
AgeCommit message (Collapse)Author
2025-12-17Rework encoding of search filters (#8324)Gravatar Alexandre Alapetite
Rework: * https://github.com/FreshRSS/FreshRSS/pull/8222 now that we have: * https://github.com/FreshRSS/FreshRSS/pull/8293 Follow-up of: * https://github.com/FreshRSS/FreshRSS/pull/8311 * More simplification * Deprecate getRawInput
2025-12-04Fix HTML encoding in preview filters (alternative) (#8259)Gravatar Alexandre Alapetite
Alternative to https://github.com/FreshRSS/FreshRSS/pull/8222 Follow-up of https://github.com/FreshRSS/FreshRSS/pull/8222 Co-authored-by: Inverle <inverle@proton.me>
2025-11-26Add `data:` to CSP in `subscriptionController` (#8253)Gravatar Inverle
Quick fix for https://github.com/FreshRSS/FreshRSS/issues/8250 Regression from https://github.com/FreshRSS/FreshRSS/pull/7646 It seems the CSP is too permissive on some pages though (`img-src *`), so should fix that too later
2025-11-11Housekeeping lib_rss.php (#8193)Gravatar Alexandre Alapetite
* Housekeeping lib_rss.php `lib_rss.php` had become much too large, especially after https://github.com/FreshRSS/FreshRSS/pull/7924 Moved most functions to other places. Mostly no change of code otherwise (see comments). * Extension: composer run-script phpstan-third-party
2025-10-22Add option to apply filter actions to existing articles (#7959)Gravatar Tommaso Ferrari
* Add option to apply filter actions to existing articles * make fix-all * Fixes * Another approach with preview New approach: https://github.com/FreshRSS/FreshRSS/pull/7959/commits/20479475c90ac954b991b3703c3cc76c16aa2d5c <img width="666" height="202" alt="image" src="https://github.com/user-attachments/assets/bb68ede4-60c8-4e0c-9317-c5ed7a6ad7df" /> Additional improvements: * Also implemented at category level, and at global level * Also implemented for favourites at global level Shortcomings: * Does not always work reliably with advanced regex, since the DB's flavour is not necessarily the same than PHP's Related: https://github.com/FreshRSS/FreshRSS/pull/8141 * make fix-all --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2025-10-01configurable notification timeout (#7942)Gravatar maTh
Ref #7931 Ref #5466 Ref #6409 added configuration in "Display" <img width="636" height="167" alt="grafik" src="https://github.com/user-attachments/assets/7bbc9f26-d91b-4dd2-b715-1d3f9b7a9ad3" /> * i18n: fr * Update app/i18n/pl/conf.php Co-authored-by: Inverle <inverle@proton.me> * make fix-all * max() * Minor whitespace (I am not a fan of excessive vertical indenting) --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> Co-authored-by: Inverle <inverle@proton.me>
2025-09-21Add option for CSP frame-ancestors (#7857)Gravatar Alexandre Alapetite
* Add option for CSP frame-ancestors https://github.com/FreshRSS/FreshRSS/discussions/7856 * Revert contentSelectorPreviewAction * Same for f.php and api * Fix double init in f.php * No sandbox for API page
2025-08-07PHPStan: finalise strictArrayFilter (#7794)Gravatar Alexandre Alapetite
As well as reportPossiblyNonexistentConstantArrayOffset. And disable PHPStan-next from GitHub Action, since the work is completed for now.
2025-08-01Rework fetch favicons (#7767)Gravatar Alexandre Alapetite
* Use main function `httpGet()` instead of local one; * Use HTTP cache, also between users; * Do not default to feed URL when there is no website URL TODO for later: consider supporting Atom's `<icon>` and RSS 2.0's `<image>` https://github.com/FreshRSS/FreshRSS/issues/7774
2025-06-30Implement custom feed favicons (#7646)Gravatar Inverle
Closes #3789, #6503 Icon setting when no custom icon is set yet: ![image](https://github.com/user-attachments/assets/28b07dd0-7dac-4c76-b1d7-77035f91a87a) - `Change...` button opens a file dialog, and after selecting a file shows the chosen icon in the preview on the left. `Submit` must be clicked after selecting the icon. - `Reset to default` changes the preview icon to the default one, and also requires `Submit` to be clicked to apply the changes. Full list of changes: - CSP now includes `blob:` in `img-src` for - `indexAction()` and `feedAction()` in `subscriptionController.php` - all of the view actions in `indexController.php` - Introduce new attribute `customFavicon (boolean)` for feeds that indicates if the feed has a custom favicon - `hashFavicon()` in `Feed.php` is dependent on this attribute - `hashFavicon()` has a new parameter called `skipCache (boolean)` that allows the reset of the favicon hash for the Feed object - `resetFaviconHash()` just calls `hashFavicon(skipCache: true)` - `f.php` URLs now have the format of `/f.php?h=XXXXX&t=cachebuster`, where the `t` parameter is only used for serving custom favicons - if `t` parameter is set, `f.php` returns a `Cache-Control: immutable` header - `stripos` and `strpos` were changed to `str_contains` in various places (refactor) - JS for handling the custom favicon configuration logic is in `extra.js` inside `init_update_feed()` which is called when feed configuration is opened from the aside or when the subscription management page with the feed is loaded - Server-side code for uploading the icon in `subscriptionController.php` under `feedAction()` - Errors that may occur during the setting of a custom favicon: - Unsupported image file type (handled only server-side with `isImgMime()`) - When the file is bigger than 1 MiB (default), handled both client-side and server-side - Standard feed error when `updateFeed()` fails - JS vars `javascript_vars.phtml` are no longer escaped with `htmlspecialchars()`, instead with json encoding, - CSS for disabled buttons was added - Max favicon file size is configurable with the `max_favicon_upload_size` option in `config.php` (not exposed via UI) - Custom favicons are currently deleted only when they are either reset to the default icon, or the feed gets deleted. They do not get deleted when the user deletes their account without removing their feeds first. - ` faviconPrepare()` and `faviconRebuild()` are not allowed to be called when the `customFavicon` attribute is `true` - New i18n strings: - `'sub.feed.icon' => 'Icon'` - `'sub.feed.change_favicon' => 'Change…'` - `'sub.feed.reset_favicon' => 'Reset to default'` - `'sub.feed.favicon_changed_by_ext' => 'The icon has been set by the <b>%s</b> extension.'` - `'feedback.sub.feed.favicon.too_large' => 'Uploaded icon is too large. The maximum file size is <em>%s</em>.'` - `'feedback.sub.feed.favicon.unsupported_format' => 'Unsupported image file format!'` - Extension hook `custom_favicon_hash` - `setCustomFavicon()` method - `resetCustomFavicon()` method - `customFaviconExt` and `customFaviconDisallowDel` attributes - example of usage: https://github.com/FreshRSS/Extensions/pull/337 - Extension hook `custom_favicon_btn_url` - Allows extensions to implement a button for setting a custom favicon for individual feeds by providing an URL. The URL will be sent a POST request with the `extAction` field set to either `query_icon_info` or `update_icon`, along with an `id` field which describes the feed's ID.
2025-05-05Fix duplicate HTTP header for POST (#7556)Gravatar Alexandre Alapetite
Using POST with JSON would add `Content-Type: application/json` again and again everytime the feed's settings were saved
2025-03-05Fix regression cURL HTTP headers (#7403)Gravatar Alexandre Alapetite
* Fix regression cURL HTTP headers fix https://github.com/FreshRSS/FreshRSS/issues/6712#issuecomment-2697961491 We would sometimes wrongly override the default HTTP headers of SimplePie https://github.com/FreshRSS/simplepie/pull/33 https://github.com/simplepie/simplepie/pull/912 * Sync SimplePie https://github.com/FreshRSS/simplepie/pull/33
2025-01-25Improve cURL proxy options (#7231)Gravatar Alexandre Alapetite
3 is now used for CURLPROXY_HTTPS2 https://github.com/curl/curl/blob/f07612cd9ae1ec50b9bedd749171ad75203c9e7e/include/curl/curl.h#L789 Related to https://github.com/FreshRSS/FreshRSS/issues/7209
2025-01-10Reduce undeeded use of elvis operator ?: (#7204)Gravatar Alexandre Alapetite
2024-12-28Fix regressions on some array structures (#7155)Gravatar Alexandre Alapetite
regressions from https://github.com/FreshRSS/FreshRSS/pull/7131 fix https://github.com/FreshRSS/FreshRSS/issues/7154
2024-12-11Improved CSS filter (#7091)Gravatar Alexandre Alapetite
* Improved CSS filter Remove unwanted elements both before and after sanitizing fix https://github.com/FreshRSS/FreshRSS/issues/7084 Improved fix bug in https://github.com/FreshRSS/FreshRSS/commit/33fd07f6f26310d4806077cc87bcdf9b8b940e35#commitcomment-150152171 * fix typing
2024-12-10OPML export/import for cssFullContentConditions (#7082)Gravatar Alexandre Alapetite
Follow-up of https://github.com/FreshRSS/FreshRSS/commit/33fd07f6f26310d4806077cc87bcdf9b8b940e35, which should have been a PR.
2024-12-10Conditional retrievalGravatar Alexandre Alapetite
fix https://github.com/FreshRSS/FreshRSS/issues/6149
2024-10-15Fix PHPCS ControlSignature (#6896)Gravatar Alexandre Alapetite
Regression from https://github.com/FreshRSS/FreshRSS/pull/6666 We were not checking anymore for whitespace rules in e.g. `if (true) {`
2024-10-14New unicity policies for feeds with bad GUIDs (#4487)Gravatar Alexandre Alapetite
New set of unicity criteria options. New tolerance heuristic: > `$invalidGuidsTolerance` (default 0.05) The maximum ratio (rounded) of invalid GUIDs to tolerate before degrading the unicity criteria. > Example for 0.05 (5% rounded): tolerate 0 invalid GUIDs for up to 9 articles, 1 for 10, 2 for 30, 3 for 50, 4 for 70, 5 for 90, 6 for 110, etc. > The default value of 5% rounded was chosen to allow 1 invalid GUID for feeds of 10 articles, which is a frequently observed amount of articles.
2024-10-13New feed mode: HTML + XPath + JSON dot notation (JSON in HTML) (#6888)Gravatar Alexandre Alapetite
* New feed mode: HTML + XPath + JSON dot notation (JSON in HTML) Same as `JSON+DotNotation` but first extracting the JSON string from an HTML document thanks to an XPath expression. Example: `//script[@type='application/json']` fix https://github.com/FreshRSS/FreshRSS/discussions/6876 * JavaScript UI to show/hide new field * Casing xPathToJson * Slight renaming
2024-09-22Fix HTML encodings in e.g. cURL options (#6821)Gravatar Alexandre Alapetite
* Fix HTML encodings in e.g. cURL options * Trim headers whitespace
2024-09-21Add HTTP Headers option (#6820)Gravatar Eugen Gorbunov
* Add new strings to lang files * Add HTTP headers field to feed forms * A few improvements --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-09-11PHPStan booleansInConditions (#6793)Gravatar Alexandre Alapetite
* PHPStan booleansInConditions * Uniformisation
2024-04-25Refactoring: Rename dotpath into dotnotation (#6369)Gravatar maTh
* KIND_JSON_DOTPATH -> KIND_JSON_DOTNOTATION * TYPE_JSON_DOTPATH => TYPE_JSON_DOTNOTATION * json_dotpath => json_dotnotation * dotPathsForStandardJsonFeed => dotNotationForStandardJsonFeed * TYPE_JSON_DOTNOTATION = 'JSON+DotPath' => 'JSON+DotNotation' * documentation: OPML.md * convertJsonToRss() * $dotpaths => $dotnotations * FreshRSS_Feed_Exception * comment * Compatibility TYPE_JSON_DOTPATH --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-04-10PHP 8.3 #[\Override] (#6273)Gravatar Alexandre Alapetite
* PHP 8.3 #[\Override] https://php.watch/versions/8.3/override-attr With PHPStan `checkMissingOverrideMethodAttribute` https://phpstan.org/config-reference#checkmissingoverridemethodattribute And modified the call to phpstan-next on the model of https://github.com/FreshRSS/Extensions/pull/228 (more robust than the find method, which gave some strange errors) * Update extension example accordingly
2024-02-26New feature: shareable user query (#6052)Gravatar Alexandre Alapetite
* New feature: shareable user query Share the output of a user query by RSS / HTML / OPML with other people through unique URLs. Replaces the global admin token, which was the only option (but unsafe) to share RSS outputs with other people. Also add a new HTML output for people without an RSS reader. fix https://github.com/FreshRSS/FreshRSS/issues/3066#issuecomment-648977890 fix https://github.com/FreshRSS/FreshRSS/issues/3178#issuecomment-769435504 * Remove unused method * Fix token saving * Implement HTML view * Update i18n for master token * Revert i18n get_favorite * Fix missing i18n for user queries from before this PR * Remove irrelevant tests * Add link to RSS version * Fix getGet * Fix getState * Fix getSearch * Alternative getSearch * Default getOrder * Explicit default state * Fix test * Add OPML sharing * Remove many redundant SQL queries from original implementation of user queries * Fix article tags * Use default user settings * Prepare public search * Fixes * Allow user search on article tags * Implement user search * Revert filter bug * Revert wrong SQL left outer join change * Implement checkboxes * Safe check of OPML * Fix label * Remove RSS button to favour new sharing method That sharing button was using a global admin token * First version of HTTP 304 * Disallow some recusrivity fix https://github.com/FreshRSS/FreshRSS/issues/6086 * Draft of nav * Minor httpConditional * Add support for offset for pagination * Fix offset pagination * Fix explicit order ASC * Add documentation * Help links i18n * Note about deprecated master token * Typo * Doc about format
2024-01-10JSONFeeds, JSON scraping, and POST requests for feeds (#5662)Gravatar eta-orionis
* allow POST requests for feeds * added json dotpath and jsonfeed subscriptions. No translation strings yet * debug and fix jsonfeed parser * bugfix params saved when editing feed * added translations for JSON features * Update docs for web scraping * make fix-all and revert unrelated changes, plus a few manual fixes, but there are still several type errors * Fix some i18n * refactor json parsing for both feed types * cleanup unnecessary comment * refactored generation of SimplePie for XPath and JSON feeds * Fix merge error * Update to newer FreshRSS code * A bit of refactoring * doc, whitespace * JSON Feed is in two words * Add support for array syntax * Whitespace * Add OPML export/import * Work on i18n * Accept application/feed+json * Rework POST * Fix update * OPML for cURL options * Fix types * Fix Typos --------- Co-authored-by: Erion Elmasllari <elmasllari@factorsixty.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-12-18Pass PHPStan level 8 (#5946)Gravatar Alexandre Alapetite
* Pass PHPStan level 8 And prepare for PHPStan level 9 https://phpstan.org/user-guide/rule-levels * Revert wrong replace in comment * Fix PHPStan level 8 * Update PHPStan and other dev dependencies * Remove obsolete comment * noVariableVariables and towards bleedingEdge https://github.com/phpstan/phpstan-strict-rules https://phpstan.org/blog/what-is-bleeding-edge * More bleedingEdge * A bit more PHPStan level 9 * More PHPStan level 9 * Prepare for booleansInConditions Ignore int and null * Revert wrong line * More fixes * Fix keep_max_n_unread * Stricter attribute functions * Stricter callHooks and more PHPStan level 9 * More typing * A tiny more
2023-12-15Add filter actions (auto mark read) at category and global levels (#5942)Gravatar Alexandre Alapetite
* Add filter actions (auto mark read) at category level fix https://github.com/FreshRSS/FreshRSS/issues/3497 * Add filter actions (auto mark read) at global level fix https://github.com/FreshRSS/FreshRSS/issues/2788 * Fix feed category ID * Minor comment
2023-12-14Remove variable default_category (#5945)Gravatar Alexandre Alapetite
Not really used, and causing bug in https://github.com/FreshRSS/FreshRSS/pull/5942 ``` Fatal error: Uncaught Error: Typed property FreshRSS_View::$default_category must not be accessed before initialization in /var/www/FreshRSS/app/views/helpers/category/update.phtml:218 Stack trace: #0 /var/www/FreshRSS/lib/Minz/View.php(93): include() #1 /var/www/FreshRSS/lib/Minz/View.php(143): Minz_View->includeFile() #2 /var/www/FreshRSS/app/views/category/update.phtml(9): Minz_View->renderHelper() #3 /var/www/FreshRSS/lib/Minz/View.php(93): include('...') #4 /var/www/FreshRSS/lib/Minz/View.php(115): Minz_View->includeFile() #5 /var/www/FreshRSS/lib/Minz/View.php(75): Minz_View->render() #6 /var/www/FreshRSS/lib/Minz/Dispatcher.php(59): Minz_View->build() #7 /var/www/FreshRSS/lib/Minz/FrontController.php(61): Minz_Dispatcher->run() #8 /var/www/FreshRSS/p/i/index.php(59): Minz_FrontController->run() #9 {main} thrown in /var/www/FreshRSS/app/views/helpers/category/update.phtml on line 218 ```
2023-12-03Rework keepmax (#5905)Gravatar Alexandre Alapetite
* Rework keepmax fix https://github.com/FreshRSS/FreshRSS/issues/5702 fix https://github.com/FreshRSS/FreshRSS/issues/5870 * More WIP * Minor progress * Progress * Beta * Improved debug message * Revert noCommit * Fix variable reset * Remove debug syslogs
2023-11-16Use strict_types (#5830)Gravatar Luc SANCHEZ
* Little's optimisations and booleans in conditions * Apply strict type * Apply strict type * Apply strict type * Fix multiple bugs with PHP 8.2 and 8.3 * Many declares missing, more errors fixed * Apply strict type * Another approach * Stronger typing for Minz_Session * Fix case of SQLite --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-09-06Remove obsolete TTL migration code (#5625)Gravatar Alexandre Alapetite
Remove `updateTTL` function used to help migration to 5+ year-old FreshRSS 1.10 and FreshRSS 0.7.3 https://github.com/FreshRSS/FreshRSS/pull/1750 This function contributed to locking the database https://github.com/FreshRSS/FreshRSS/pull/5574 Subset of https://github.com/FreshRSS/FreshRSS/pull/3558
2023-07-07Chore/processing of depreciations and updating code to php72 minimum (#5504)Gravatar Luc SANCHEZ
* processing of depreciations and updating of code to php7.2 minimum * Autoformat many strange array indenting And revert a few unwanted changes --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-06-15Fix slider views (#5469)Gravatar Alexandre Alapetite
* Fix slider titles And fix full-page view of category configuration. FIx https://github.com/FreshRSS/FreshRSS/pull/5449#issuecomment-1590021947 * Fix user queries and user management Implement https://github.com/FreshRSS/FreshRSS/pull/5469#issuecomment-1591957935
2023-04-17Complete PHPStan Level 6 (#5305)Gravatar Alexandre Alapetite
* Complete PHPStan Level 6 Fix https://github.com/FreshRSS/FreshRSS/issues/4112 And initiate PHPStan Level 7 * PHPStan Level 6 for tests * Use phpstan/phpstan-phpunit * Update to PHPStan version 1.10 * Fix mixed bug * Fix mixed return bug * Fix paginator bug * Fix FreshRSS_UserConfiguration * A couple more Minz_Configuration bug fixes * A few trivial PHPStan Level 7 fixes * A few more simple PHPStan Level 7 * More files passing PHPStan Level 7 Add interface to replace removed class from https://github.com/FreshRSS/FreshRSS/pull/5251 * A few more PHPStan Level 7 preparations * A few last details
2023-04-08Fix feed priority (#5274)Gravatar Alexandre Alapetite
Fix https://github.com/FreshRSS/FreshRSS/issues/5273
2023-04-07Phpstan Level6 for View.php (#5269)Gravatar Luc SANCHEZ
* Remarque's from Alkarex * indentation * indentation * Apply suggestions from code review Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> * Remarque's from Alkarex * A few improvements * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Fixes and improvments * Fix getTagsForEntry --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-04-07Use typed access to request parameters (#5267)Gravatar Alexandre Alapetite
* Use typed access to request parameters This was a big source of mixed datatypes in many places * Fix notifications * Fix bookmarkAction
2023-03-21Typehint some Controllers (#5106)Gravatar Luc SANCHEZ
* Typehint to Controllers * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex * Remarque's from Alkarex --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
2023-02-09XML+XPath (#5076)Gravatar Alexandre Alapetite
* XML+XPath #fix https://github.com/FreshRSS/FreshRSS/issues/5075 Implementation allowing to take an XML document as input using an XML parser (instead of an HTML parser for HTML+XPath) * Remove noise from another PR * Better MIME for XML * And add glob *.xml for cache cleaning * Minor syntax * Add glob json for clean cache
2023-02-08Fix disabling proxy (#5082)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/5081 Allow disabling curl proxy for specific feed, when proxy is defined globally
2023-01-26Fix error handling when updating URL (#5039)Gravatar Alexandre Alapetite
Fix 3 related error handling when updating the feed URL with an invalid URL. Previously leading to unclear 500 page with additional PHP errors.
2022-12-31fix: favicon after editing feed url (#4975)Gravatar Sadetdin EYILI
refactor: replace `$cat` variable by the `$values['category']` values
2022-10-11Fix encoding CSS filter (#4707)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/4705
2022-10-09Add support for custom XPath date/time format (#4703)Gravatar Alexandre Alapetite
* Add support for custom XPath date/time format #fix https://github.com/FreshRSS/FreshRSS/issues/4701 Improvement of https://github.com/FreshRSS/FreshRSS/pull/4220 * Format is not XPath * Remove TODOs in en-GB
2022-10-03Improved: Subscription Management: Show the position number (#4679)Gravatar maTh
* the code * improvement * fix doubled parameter
2022-08-20Implemented advanced feed settings to allow cookies and HTTP redirects. (#4470)Gravatar Roman D
* Implemented advanced feed settings to allow cookies and HTTP redirects. * i18n fr Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-08-18XPath ability to define the UID manually (#4507)Gravatar Alexandre Alapetite
* XPath ability to define the UID manually * Fix error in i18n