47 Commits

Author SHA1 Message Date
Alexandre Alapetite
a18c35046d Housekeeping lib_rss.php (#8193)
* 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-11-11 08:17:12 +01:00
Alexandre Alapetite
5e622c60fa Rename Extensions branch from master to main (#8194)
For uniformity with other repos
dd20c6003e
I made a tag https://github.com/FreshRSS/Extensions/releases/tag/master for back compatibility
2025-11-09 11:58:29 +01:00
Alexis Degrugillier
eee8b8c03f Add support for extension compatibility (#8081)
The compatibility does support only a minimum version of FreshRSS. If we need
something a bit more clever in the future, it is possible to handle a rule
with a bit more complexity.

See https://github.com/FreshRSS/FreshRSS/issues/5903

* Update app/Controllers/extensionController.php

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>

* Update app/i18n/pl/admin.php

Co-authored-by: Inverle <inverle@proton.me>

* Minor move phpstan-type

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Inverle <inverle@proton.me>
2025-10-21 23:49:06 +02:00
maTh
2bcc090622 configurable notification timeout (#7942)
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-10-01 10:48:07 +02:00
Inverle
858616f075 Fixes for no-cache.txt (#7907)
* Closes and fixes error from #7885
* `no-cache.txt` is now respected in `f.php`, `ext.php` and `serve` action in `extensionController`
   * And in all other places that weren't checking for `no-cache.txt` (some extensions maybe)
2025-09-05 08:16:52 +02:00
Inverle
18b5c8ec6d Handle redirects when scraping feed from HTML (#7654)
* Handle redirects when scraping feed from HTML

* pass codesniffer

* pass PHPStan

* Optimize

* Another approach relying on HTML base
Standard way to save an HTML document with relative references

* Fix case of existing HTML base
which should not be overriden

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2025-06-22 00:09:18 +02:00
Alexandre Alapetite
0c33d27139 Secure serving of user files from extensions (#7495)
* Secure serving of user files from extensions
fix https://github.com/FreshRSS/FreshRSS/issues/4930

* More fixes

* Typo
2025-04-07 08:47:42 +02:00
Alexandre Alapetite
3336631a84 Catch extension exceptions in override (#7475)
* Catch extension exceptions in override
https://github.com/FreshRSS/Extensions/pull/300#issuecomment-2768578464

* Fix error message
2025-04-01 17:55:20 +02:00
Alexandre Alapetite
825ccf5556 Hide base theme (#7234) 2025-01-21 23:31:40 +01:00
Alexandre Alapetite
b1d24fbdb7 PHPStan 2.0 (#7131)
* PHPStan 2.0
fix https://github.com/FreshRSS/FreshRSS/issues/6989
https://github.com/phpstan/phpstan/releases/tag/2.0.0
https://github.com/phpstan/phpstan/blob/2.0.x/UPGRADING.md

* More

* More

* Done

* fix i18n CLI

* Restore a PHPStan Next test
For work towards PHPStan Level 10

* 4 more on Level 10

* fix getTagsForEntry

* API at Level 10

* More Level 10

* Finish Minz at Level 10

* Finish CLI at Level 10

* Finish Controllers at Level 10

* More Level 10

* More

* Pass bleedingEdge

* Clean PHPStan options and add TODOs

* Level 10 for main config

* More

* Consitency array vs. list

* Sanitize themes get_infos

* Simplify TagDAO->getTagsForEntries()

* Finish reportAnyTypeWideningInVarTag

* Prepare checkBenevolentUnionTypes and checkImplicitMixed

* Fixes

* Refix

* Another fix

* Casing of __METHOD__ constant
2024-12-27 12:12:49 +01:00
Alexis Degrugillier
ad2c6e6fbf Add privacy settings on extension list retrieval (#4603)
* Add privacy settings on extension list retrieval

There is a new privacy page to handle all configuration related to privacy. At
the moment, only privacy related to extensions can be configured.

The new settings allow to change the location of the extension list file and to
choose if the selected file is cached for a day or retrieved for each request.

Fix #4570

* Update code to pass PHPStan

* make fix-all

---------

Co-authored-by: maTh <math-home@web.de>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-10-20 20:51:49 +02:00
Alexandre Alapetite
4f29b715ef Use curl to fetch extensions list (#6767)
fix https://github.com/FreshRSS/FreshRSS/issues/6744
2024-09-06 08:51:51 +02:00
Alexandre Alapetite
d2247221bb Minor update whitespace PHPCS rules (#6666)
* 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-08-01 20:31:40 +02:00
Alexandre Alapetite
350edf398c PHP 8.3 #[\Override] (#6273)
* 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-10 15:33:43 +02:00
Alexandre Alapetite
1e5f5078ed Sanitize parsing list of extensions (#6016)
fix https://github.com/FreshRSS/FreshRSS/issues/6015
2024-01-03 10:26:09 +01:00
Alexandre Alapetite
a80a5f48a1 Pass PHPStan level 8 (#5946)
* 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-18 17:59:16 +01:00
Luc SANCHEZ
30c7a61a9b Use strict_types (#5830)
* 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-11-16 22:43:00 +01:00
Luc SANCHEZ
f8f163d054 Chore/processing of depreciations and updating code to php72 minimum (#5504)
* 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-07-07 22:36:27 +02:00
Alexandre Alapetite
228d7adfdb Fix slider views (#5469)
* 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-06-15 12:47:47 +02:00
Alexandre Alapetite
3fe68a3285 Allow deep link to extension configuration (#5449)
* Allow deep link to extension configuration
Full screen

* Support slider

* Add aside_configure
Fix https://github.com/FreshRSS/FreshRSS/pull/5449#issuecomment-1588089769
2023-06-13 22:40:28 +02:00
Alexandre Alapetite
f3760f138d Complete PHPStan Level 6 (#5305)
* 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-17 08:30:21 +02:00
Alexandre Alapetite
36aa0122e1 Fix extensions in actualize_script (#5243)
* Fix extension freshrss_user_maintenance in actualize_script
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/3440

The hook was called before registering all the extensions for the current user

* PHPStan Level 6 for extensions
And remove 5-year old legacy format of enabled extensions < FreshRSS 1.11.1

* Fix multiple bugs in extensions

* Minor typing

* Don't change signature of methods supposed to be overridden

* PHPStan Level 9 and compatibility Intelliphense

* Set as final the methods not supposed to be overriden
2023-04-04 10:23:26 +02:00
maTh
b1a74a3476 Update extensionController.php (#4571) 2022-08-31 21:34:18 +02:00
Alexandre Alapetite
1335a0e3cf PHPStan level 5 (#4110)
* 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
2022-01-04 13:59:09 +01:00
Alexandre Alapetite
77e9877316 Add PHPStan (#4021)
* 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
2021-12-31 17:00:51 +01:00
Alexandre Alapetite
947e918f05 Travis: Enforce phpcs line length + whitespace (#3488)
* Update Travis line length

* Also check whitespace in CSS files

* Fix line length ext.php

* More syntax, string templates

* Fix exclude-pattern

* Test JS files as well
2021-02-28 12:26:24 +01:00
Alexis Degrugillier
8c4d71da2e Add missing translations (#3034)
* Add missing translations

* Add a simple way to check if an i18n key exists

There is a rule in the makefile to access it directly
2020-06-05 20:16:04 +02:00
Marien Fressinaud
de26531178 tec: Provide a Minz_Mailer class (#2476)
* Add Minz_View::_path method (replace change_view)

The `_path` method is more powerful since it allows to choose the file
extension. It is also Minz_Request-agnostic, which is useful to reuse
the Minz_View class in other places.

`change_view` is now deprecated and a warning is logged if we use it.

* Provide a Minz_Mailer to send emails

It uses PHPMailer under the hood and only supports PHP >= 5.5
2019-08-15 17:19:12 +02:00
Marien Fressinaud
49e1a2c579 Allow to change the view layout (#2467)
The `_useLayout` function is marked as deprecated, replaced by a more
powerful `_layout` function.
2019-08-02 11:40:57 +02:00
Alexandre Alapetite
6a56894e94 New extension event + Tumblr GDPR (#1924)
* New extension event + Tumblr GDPR

https://github.com/FreshRSS/FreshRSS/issues/1894
simplepie_before_init event

* Refactor extension enabling + Tumblr GDPR enabled by default

Add possibility for extensions to be enabled by default, and disabled
back by users.

* Minor whitespace
2018-06-09 15:58:18 +02:00
Alexis Degrugillier
a14c160beb Update travis config (#1751)
I've enabled tests on PHP 7.2 since it's the latest stable version.
I've also installed phpcs from composer since PEAR is not available for all versions of PHP.
2018-01-11 19:18:29 +01:00
Kevin Papst
3902d3f433 Show existing extensions in admin panel (#1708)
* first draft

* display installed extension state

* fixed whitespace vs tabs

* added translation in all languages

* added error checks and log messages

* fixed tabs vs whitespace

* another try in fixing whitespaces

* another try in fixing whitespaces

* improved extension list translations

* using JSON from official extension repo

* improved version compare

* updated translations

* French translation
2017-12-06 21:04:45 +01:00
Marien Fressinaud
789d9fc6c8 Fix coding style in extension manager
Yep, same as 8968288...
2015-01-14 23:40:18 +01:00
Marien Fressinaud
2f1116818d Fix extension interface
- Seperate user and system extensions on extension/index
- extension/configure shows index page with the slider opened
  if request is done with ajax
- Reorganize some extension view files
2015-01-14 23:30:19 +01:00
Marien Fressinaud
8968288600 Fix extension API (coding style)
is_enabled() becomes isEnabled(). Sorry for this coding style mistake :s
2015-01-14 22:22:30 +01:00
Marien Fressinaud
806b4de54f Add mechanism at (un)install of an extension
Test if the install or uninstall has been successfully performed.
If these methods return true, all is ok but if a string is returned,
the string must explain the problem. This problem is stored in log file.

A feedback is given to explain to check log file.

This commit fix a problem in the english translation of
feedback.sub.feed.internal_problem.
2015-01-14 21:38:35 +01:00
Marien Fressinaud
5bd7997d41 Call handleConfigureAction() even for GET requests
See https://github.com/FreshRSS/FreshRSS/issues/252
2015-01-08 14:30:05 +01:00
Marien Fressinaud
73023bc12b Merge branch 'dev' into 252-extensions
Conflicts:
	app/FreshRSS.php
	app/Models/Configuration.php
	app/views/index/index.phtml
	app/views/index/normal.phtml
	lib/Minz/Configuration.php
	lib/Minz/Translate.php
	lib/lib_rss.php
2015-01-08 14:18:32 +01:00
Marien Fressinaud
76358846ab Implement extension deletion
See https://github.com/FreshRSS/FreshRSS/issues/252
2014-12-08 13:36:08 +01:00
Marien Fressinaud
0543f96a97 Update comments for ExtensionController
See https://github.com/FreshRSS/FreshRSS/issues/252
2014-12-08 13:22:11 +01:00
Marien Fressinaud
c6dfec3ad3 Add behaviour to configure action (extensions)
- Put extension configure view in dir_ext/configure.phtml
- Handle POST action in Extension->handleConfigureAction() method

See https://github.com/FreshRSS/FreshRSS/issues/252
2014-12-08 12:01:47 +01:00
Marien Fressinaud
bc81979a6b Add default behaviour for configure / remove ext
See https://github.com/FreshRSS/FreshRSS/issues/252
2014-12-06 17:25:01 +01:00
Marien Fressinaud
2da7c05fa6 Update i18n (extensions)
See https://github.com/FreshRSS/FreshRSS/issues/252
2014-12-06 17:15:20 +01:00
Marien Fressinaud
9d66462c1d Fix typo (extensions)
- change feedback.extension into feedback.extensions
- disable button is pushed by default

See https://github.com/FreshRSS/FreshRSS/issues/252
2014-12-06 16:48:13 +01:00
Marien Fressinaud
4c888590e6 Improve system/user types for extensions
- system extensions can only be managed by an administrator
- system extensions are loaded for all users (even if not logged)
- user extensions are loaded for logged users only
- system extensions loading is saved in global config.php file

See https://github.com/FreshRSS/FreshRSS/issues/252
2014-12-06 16:41:06 +01:00
Marien Fressinaud
2e4682ebd4 Add enable / disable extension features
See https://github.com/FreshRSS/FreshRSS/issues/252
2014-12-06 16:17:11 +01:00
Marien Fressinaud
9fc60317ee First draft for listing and manipulate extensions
See https://github.com/FreshRSS/FreshRSS/issues/252
2014-12-05 14:17:02 +01:00