aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/indexController.php
AgeCommit message (Collapse)Author
2024-11-28Upgrade code to php 8.1 (#6748)Gravatar Luc SANCHEZ
* revert Fix code indentation Fix code Upgrade code to php 8.1 * fix remarques * code review * code review * code review * Apply suggestions from code review * code review * Fixes * Many remainging updates of array syntax * Lost case 'reading-list' * Uneeded PHPDoc --------- Co-authored-by: Luc Sanchez <l.sanchez-prestataire@alptis.fr> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-08-01Minor update whitespace PHPCS rules (#6666)Gravatar Alexandre Alapetite
* Minor update whitespace PHPCS rules To simplify our configuration, apply more rules, and be clearer about what is added or removed compared with PSR12. Does not change our current conventions, but just a bit more consistent. * Forgotten *.phtml * Sort exclusion patterns + add a few for Extensions repo * Relaxed some rules
2024-05-07Fix individual OMPL feed export (#6435)Gravatar Alexandre Alapetite
fix https://github.com/FreshRSS/FreshRSS/issues/6433
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-04-08Fix paging posts per page (#6268)Gravatar Alexandre Alapetite
* Fix paging posts per page fix https://github.com/FreshRSS/FreshRSS/issues/6062 Due to strange scoping of anonymous function trying to update a static property * Better type syntax
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-15PHPStan prepare exceptions (#6037)Gravatar Alexandre Alapetite
Take advantage of https://phpstan.org/blog/bring-your-exceptions-under-control Minimum changes to pass `tooWideThrowType` and `implicitThrows`. Revert some mistakes from: https://github.com/FreshRSS/FreshRSS/pull/5504 Preparation needed before new PRs of the same type: https://github.com/FreshRSS/FreshRSS/pull/5962 Fix several wrong PHPDocs and catches: > Method ... has ...Exception in PHPDoc @throws tag but it's not thrown. > Dead catch - ...Exception is never thrown in the try block.
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-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-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-05-11A few additional PHPStan rules (#5388)Gravatar Alexandre Alapetite
A subset of https://github.com/phpstan/phpstan-strict-rules
2023-05-02PHPStan Level 7 complete DAOs (#5354)Gravatar Alexandre Alapetite
* PHPStan Level 7 complete DAOs * Finalise PHPStan Level 7 for CategoryDAO * PHPStan Level 7 for Context and Search * Apply suggestions from code review Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com>
2023-04-23PHPStan Level 7 for ten more files (#5327)Gravatar Alexandre Alapetite
* PHPStan Level 7 for nine more files * Minor syntax * One more
2023-04-17More consistent use of iterable type (#5308)Gravatar Alexandre Alapetite
For `yield`
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-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-27Cleaning code and typehinting (#5064)Gravatar Luc SANCHEZ
* Cleaning code and typehinting * Fix remarque alphabetic order * Cleaning * rollback self:: * Update Context.php * Fix remarques * Fix remarques * Fix remarques * Remarque's from Alkarex * Remarque's from Alkarex * Cast higher up * Fix Level 5 * Claiming Level 6 Cf. https://github.com/FreshRSS/FreshRSS/pull/5230 * Address my comments * indexController as Level 6 as well * Fixed some wrong types --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-03-22Consistent entry ID type (32-bit compatibility) (#5213)Gravatar Alexandre Alapetite
* Remove FreshRSS_Searchable for better types The interface was not used, and it was preventing more precise types for the different `searchById()` methods, as they each have different input and output types. * Consistent entry ID Entry IDs (which are 64-bit integers) must be processed as string to be compatible with 32-bit platforms * Fix type * A few more related types * PHPStan level 6 * Some more casts needed * String cast for htmlspecialchars
2023-03-21Improved: show Terms of Service in config menu (#5215)Gravatar maTh
* Use constants for path to TOS * improve comments * TOS title moved to template * TOS available via config menu * CSS: improve handling of content of TOS/about * give info about set/unset TOS in system config * fix target * i18n FR * i18n DE
2023-02-03Remove -x on some files not needing it (#5065)Gravatar Alexandre Alapetite
2023-01-18tec: Update the lib_opml (#4403)Gravatar berumuron
* fix: Fix undefined GLOB_BRACE on Alpine The manual states that: > Note: The GLOB_BRACE flag is not available on some non GNU systems, > like Solaris or Alpine Linux. This generated an error on Alpine. Reference: https://www.php.net/manual/function.glob.php * fix: List details of feeds for OPML exportation The details are necessary to export the XPath information, the CSS full content path and read actions filters. * Update LibOpml to 0.4.0 * Refactor OPML importation to be more robust First, it fixes two regressions introduced by the update of lib_opml: - title attribute is used when text attribute is missing; - the OPML category attribute is used as a fallback for feeds categories. In a related way, if also fixes a problem when a feed had both a parent category outline and a category attribute. Before, it only considered the attribute as its category, but now it considers the parent outline. Then, it counts category limit correctly by not increasing `$nb_categories` if the category already exists. * Exclude lib_opml from the CodeSniffer * Fix variable names when logging some errors * Fix catch of LibOpml Exception * Make sure to declare the category * Exclude lib_opml from PHPStan analyze * Disable markdownlint for lib_opml * Fix typos * Use auto-loading and allow updates via Composer * Fix broken links to lib_opml * Bring back the ability to import the OPML frss:opmlUrl attribute * Refactor the logs of OPML errors * Update lib_opml to the version 0.5.0 Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-08-10Refactor updateContext into its own FreshRSS_Context class (#4496)Gravatar Alexandre Alapetite
So that it is both cleaner and easier to call from other controllers and extensions
2022-07-27Fix: logs page=0 error (#4460)Gravatar maTh
* add docs of function param() * page < 0 is impossible now * show prev/next only, when there is a prev/next page * set always page params * Revert "page < 0 is impossible now" This reverts commit fdb920ee50efe2c5cf64ca2dec936ec28ab2ee6c. * Update logs_pagination.phtml
2022-07-04Dynamic OPML (#4407)Gravatar Alexandre Alapetite
* Dynamic OPML draft #fix https://github.com/FreshRSS/FreshRSS/issues/4191 * Export dynamic OPML http://opml.org/spec2.opml#1629043127000 * Restart with simpler approach * Minor revert * Export dynamic OPML also for single feeds * Special category type for importing dynamic OPML * Parameter for excludeMutedFeeds * Details * More draft * i18n * Fix update * Draft manual import working * Working manual refresh * Draft automatic update * Working Web refresh + fixes * Import/export dynamic OPML settings * Annoying numerous lines in SQL logs * Fix minor JavaScript error * Fix auto adding new columns * Add require * Add missing 🗲 * Missing space * Disable adding new feeds to dynamic categories * Link from import * i18n typo * Improve theme icon function * Fix pink-dark
2022-03-22Improve: manage feed in view within a slider (#4226)Gravatar maTh
* it works * small improvements * Update slider.js * fixed JS syntax * slider.js included in main.js * fix syntax * delete including of slider.js * Update extra.js
2022-02-28Implement Web scraping "HTML + XPath" (#4220)Gravatar Alexandre Alapetite
* More PHP type hints for Fever Follow-up of https://github.com/FreshRSS/FreshRSS/pull/4201 Related to https://github.com/FreshRSS/FreshRSS/issues/4200 * Detail * Draft * Progress * More draft * Fix thumbnail PHP type hint https://github.com/FreshRSS/FreshRSS/issues/4215 * More types * A bit more * Refactor FreshRSS_Entry::fromArray * Progress * Starts to work * Categories * Fonctional * Layout update * Fix relative URLs * Cache system * Forgotten files * Remove a debug line * Automatic form validation of XPath expressions * data-leave-validation * Fix reload action * Simpler examples * Fix column type for PostgreSQL * Enforce HTTP encoding * Readme * Fix get full content * target="_blank" * gitignore * htmlspecialchars_utf8 * Implement HTML <base> And fix/revert `xml:base` support in SimplePie https://github.com/simplepie/simplepie/commit/e49c578817aa504d8d05cd7f33857aeda9d41908 * SimplePie upstream PR merged https://github.com/simplepie/simplepie/pull/723
2022-02-06Improved: "Pagination" + load more button (#4125)Gravatar maTh
* Frontend changes done * Load more should work now also without JS * Update template.rtl.css * improved the themes' CSS * Update template.rtl.css * fix CI * CSS prop. order fixed * Rename pagination.phtml to stream-footer.phtml * use the new template name * rename key of i18n * fixed CI, that does not like the white space * rename pagination variable * Update indexController.php
2022-01-29Fix keep state after favourites tags (#4178)Gravatar Alexandre Alapetite
* Fix keep state after favourites tags #fix https://github.com/FreshRSS/FreshRSS/issues/4124 regression * Optimisation
2022-01-08Fix various typos and spelling errors in documentation, comments and code. ↵Gravatar Thomas Renes
(#4134)
2022-01-04PHPStan level 5 (#4110)Gravatar Alexandre Alapetite
* Fix most PHPDocs errors Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103 https://phpstan.org/writing-php-code/phpdoc-types * Avoid func_get_args Use variadic syntax instead https://php.net/manual/functions.arguments#functions.variable-arg-list And avoid dynamic functions names when possible to more easily identify calls and unused functions. Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103 * PHPStan level 3 * PHPStand level 4 * Update default to PHPStan level 4 * Towards level 5 * Fix level 4 regression * Towards level 5 * Pass PHPStan level 5 * Towards level 6 * Remove erronenous regression from changelog https://github.com/FreshRSS/FreshRSS/pull/4116
2021-12-31Add PHPStan (#4021)Gravatar Alexandre Alapetite
* Add PHPStan #fix https://github.com/FreshRSS/FreshRSS/issues/4016 https://phpstan.org/ ```sh composer run-script phpstan ``` * More fixes * Fix global variables * Add .phtml * Fix merge https://github.com/FreshRSS/FreshRSS/pull/4090 * Fix more warnings * Fix view errors and enable in CI * ReturnTypeWillChange * Dynamic view type * Fix Minz static/self bug
2020-05-18Fix nav_menu mark-as-read (#2909)Gravatar Alexandre Alapetite
* Fix nav_menu mark-as-read #Fix https://github.com/FreshRSS/FreshRSS/issues/2905 Fix regression from https://github.com/FreshRSS/FreshRSS/pull/2588 We need info about the first item (id_max) before being able to output nav_menu. Before https://github.com/FreshRSS/FreshRSS/pull/2588 we used to output everything in memory before starting to produce an output. Now that we stream the output, we need a temporary buffer until we have received the first item/article. * Repair loading page * Simplify CSS Make it work in Chrome as well * Lint * Partial revert * Base max_id solely on current time
2020-02-29Better performance with yield (#2588)Gravatar Alexandre Alapetite
* Better performance with yield Largely decrease the time to first byte, and reduced memory consumtion. Before, we used to make several copies in memory of the whole list of articles before sending them to the client. Now streamed as they are processed. * Travis
2019-12-22tec: Allow to change CSP header from controllersGravatar Marien Fressinaud
For an extension, I needed to call a script from an external domain. Unfortunately, the CSP headers didn't allow this domain and I had to patch manually the FreshRSS FrontController for my extension. It's obviously not a long-term solution since it has nothing to do in the core of FRSS, and I don't want to apply this patch manually at each update. With this patch, I allow changing the CSP header from inside the controller actions. It allows extensions to modify headers. It's also an opportunity to remove a bit of code from the FrontController. I wasn't happy with the previous implementation anyhow. Reference: https://github.com/flusio/xExtension-Flus/commit/ed12d56#diff-ff12e33ed31b23bda327499fa6e84eccR143
2019-10-26Add category order (#2592)Gravatar Alexis Degrugillier
* Add category order Each category has a new 'priority' attribute. It is used to sort categories in views. Categories with the same priority are sorted alphabetically. Categories with no priority are displayed after those with one. For example, if we have the following categories: - A (priority: 2) - B (no priority) - C (priority: 1) - D (priority: 2) - E (no priority) - F (priority: 1) They will be displayed in the following order: - C - F - A - D - B - E See #190 * Shorten help text It took too much room and will not be so necessary once we have drag & drop
2019-09-17Add support for terms of serviceGravatar Marien Fressinaud
This feature is optional. It is based on the presence of a `data/tos.html` file that an administrator can create. If this file exists, FreshRSS will automatically add a "ToS" checkbox on the registration page that users must check to be able to create their account.
2019-08-02Allow to change the view layout (#2467)Gravatar Marien Fressinaud
The `_useLayout` function is marked as deprecated, replaced by a more powerful `_layout` function.
2019-06-29Fix wrong mark-as-read maxId argument (#2431)Gravatar Alexandre Alapetite
Fix https://github.com/FreshRSS/FreshRSS/issues/2429
2019-02-13Less jQuery (#2234)Gravatar Alexandre Alapetite
* Less jQuery Follow-up of https://github.com/FreshRSS/FreshRSS/pull/2199 * Even less jQuery + global view unread title fix * Even less jQuery * Yet even less jQuery * Even less jQuery * Reduce some events * Even less jQuery * jQuery gone from main view +Fixed English i18n * Fix feed folded view * Remove Firefox 64 workaround Remove workaround for Gecko bug 1514498 in Firefox 64, fixed in Firefox 65 * Split to extra.js Avoid loading unneeded JavaScript code for the main view. + several adjustements * Improve CSS transition fold category * Rewrite shortcuts Remove library. Much faster, shorter, one listener instead of many. Control of the shortcut context. Fix https://github.com/FreshRSS/FreshRSS/issues/2215 * Remove debug * Minor syntax * Filter out unwanted shortcut modifiers * Menu overflow fix * Typo * Fix unfolding in mobile view * Remove jQuery from category.js * Remove jQuery from Global view
2018-10-14Ensure fast flush of HTTP headers and HTML head (#2045)Gravatar Alexandre Alapetite
* Ensure fast flush of HTTP headers and HTML head The fast flush optimisation done in https://github.com/FreshRSS/FreshRSS/pull/1133 does not seem to work anymore (need to check if it is related to a PHP version). Work-around when PHP flush() is not working Can be tested by adding a `sleep(5);` after: https://github.com/FreshRSS/FreshRSS/blob/ee902ee7c4370421802768c3105ba269a4f97b16/app/layout/layout.phtml#L27 Follow-up of the performance checks of https://github.com/FreshRSS/FreshRSS/pull/2040 * output_buffering in .user.ini for PHP CGI / FPM * Reuse .user.ini for Docker PHP config * Longer flush Flush a bit later, to be compatible with the default value of 4096 for PHP output_buffering, and thus avoid the need of tuning the value.
2018-09-29Custom labels (#2027)Gravatar Alexandre Alapetite
* First draft of custom tags https://github.com/FreshRSS/FreshRSS/issues/928 https://github.com/FreshRSS/FreshRSS/issues/1367 * SMALLINT to BIGINT for id_entry And uppercase SQL types * Fix layout for unreads * Start UI menu * Change menu order * Clean database helpers https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r217971535 * Travis rules do not understand PostgreSQL constants Grrr * Tag controller + UI * Add column attributes to tags * Use only favicon for now, for label * Fix styling for different themes * Constant for maximum InnoDB index length in Unicode https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r219052200 (I would have personnally prefered keeping the readability of a real value instead of a constant, in this case of many SQL fields) * Use FreshRSS_Factory::createCategoryDao * Add view of all articles containing any tag * Fix search in tags * Mark as read tags * Partial auto-update unread tags * More auto update tag unreads * Add tag deletion * Do not purge tagged articles * Minor comment * Fix SQLite and UI bug * Google Reader API support for user tags Add SQL check that tag names must be distinct from category names * whitespace * Add missing API for EasyRSS * Compatibility SQLite Problematic parentheses * Add SQL DISTINCT for cases with multiple tags * Fix for PostgreSQL PostgreSQL needs some additional type hint to avoid "could not determine data type of parameter $1" http://www.postgresql-archive.org/Could-not-determine-data-type-of-parameter-1-tp2171092p2171094.html
2018-09-09Minz: fix absolute URL bug (#2006)Gravatar Alexandre Alapetite
* Fix absolute URL bug https://github.com/FreshRSS/FreshRSS/issues/1946 * Better base_url guess in install.php * Revert changes in install.php
2018-03-14Light Boolean search implementation (#1828)Gravatar Alexandre Alapetite
* Light Boolean search implementation "Hello intitle:World OR date:P1D example" https://github.com/FreshRSS/FreshRSS/issues/879 * Doc Boolean search * Doc typos
2017-12-19PHP 7.2: Fix a warning when retrieving the list of entries (#1739)Gravatar Alexis Degrugillier
When retrieving the list of entries when the context was 'all' or 'starred', there was the following warning: > Warning: count(): Parameter must be an array or an object that implements Countable in /home/alexis/FreshRSS/app/Controllers/indexController.php on line 206 I fixed that by changing how the array is tested.
2017-09-22[ci] Add Travis (#1619)Gravatar Frans de Jonge
* [ci] Add Travis * Exclude some libs * Semi-auto whitespace fixes * line length in SQLite * Exclude tests from line length * Feed.php line length * Feed.php: get rid of unnecessary concat * Feed.php: line length * bootstrap.php: no newline at end of file * Allow concatenating across multiple lines * Add Travis badge * do-install line length * update-or-create-user line length * cli/create-user line length * tests/app/Models/SearchTest.php fix indentation * tests/app/Models/UserQueryTest.php fix indentation * tests/app/Models/CategoryTest.php fix indentation * [fix] PHP 5.3 on precise * cli/do-install no spaces * cli/list-users line length * cli/reconfigure line length * empty catch statements * api/index line length nonsense * spaces before semicolon * app/Models/EntryDAO bunch of indentation * extra blank lines * spaces before comma in function call * testing tabwidth * increase to 10 * comment out tabwidth line * try older phpcs version 3.0.0RC4 * line length exception for app/install.php * proper spaces * stray spaces in i18n * Minz/ModelPdo line length * Minz whitespace * greader line length * greader elseif placement * app/Models/Feed.php spacing in function argument * ignore php 5.3 * app/Models/ConfigurationSetter.php stray whitespace * EntryDAOSQLite line length * I vote for higher max line length =P * ignore SQL * remove classname complaint * line length/more legible SQL * ignore line length nonsense * greader line length * feedController issues * uppercase TRUE, FALSE, NULL * revert * importExportController lowercase null * Share.php default value not necessary because ! is_array () a few lines down * CategoryDAO constants should be UPPERCASE * EntryDAO reduce line length * contentious autofix * Allow failures on all versions of PHP except 7.1 because reasons
2016-10-15Remove superflous category requestGravatar Alexandre Alapetite
A category request was systematically done, although it is not always needed.
2016-09-11Better control of number of entries per page or RSS feedGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/1249 * Since X hours: `https://freshrss.example/i/?a=rss&hours=3` * Explicit number: `https://freshrss.example/i/?a=rss&nb=10` * Limited by `min_posts_per_rss` and `max_posts_per_rss` in user config
2016-08-13PHP 5.3 more compatibilityGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/pull/1209#issuecomment-239617504 https://github.com/FreshRSS/FreshRSS/issues/1208
2016-08-13PHP 5.3 scope compatibilityGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/1208
2016-08-12PHP 5.3 compatibility for callbackGravatar Alexandre Alapetite
https://github.com/FreshRSS/FreshRSS/issues/1208