Commit Graph

769 Commits

Author SHA1 Message Date
Alexandre Alapetite
445e49db15 Fix Minz_Extension::getVersion (#5891)
Regression from https://github.com/FreshRSS/FreshRSS/pull/5830
2023-11-17 14:59:21 +01:00
Alexandre Alapetite
e70e5542e4 Fix Minz_Session::param visibility (#5889)
Regression from https://github.com/FreshRSS/FreshRSS/pull/5830
2023-11-17 13:47:13 +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
Alexandre Alapetite
8631d6f80d Favicon: avoid echo exception (#5867)
Avoid potential Information Exposure
2023-11-14 23:27:41 +01:00
Joe Stump
641b891972 Fix trusted cidrs check (#5853)
* Fix ignored TRUSTED_PROXY issue

* Add a sub-section to the docs no property mappings for Authentik

* Typo

* Fix typing

* A few changes to the doc

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-11-11 08:40:51 +01:00
Dan Hersam
57f46922e8 Rework the behavior of favicon search (#5839)
* Rework the behavior of favicon search

Use xpath queries to reduce the filtering necessary.

Don't call checkUrl since the href value will not always be a full URL.

Check for a base path in the HTML to be used if the favicon href doesn't
start with a leading slash.

* Break long xpath query into two lines

* Fix issues found by CI
2023-11-10 09:14:34 +01:00
Alexandre Alapetite
a5748ad74f Fix lang_name (#5798)
fix https://github.com/FreshRSS/FreshRSS/issues/5797
2023-10-31 22:25:43 +01:00
Alexandre Alapetite
06d0099504 Require PHP 7.4+ (#5720)
* Require PHP 7.4+
https://github.com/FreshRSS/FreshRSS/discussions/5474

* Update Docker oldest
Alpine 3.13 with PHP 7.4.26

* Add missing packets to Docker oldest

* Update to typed properties
https://php.net/migration74.new-features#migration74.new-features.core.typed-properties

* More types
2023-10-30 20:47:27 +01:00
Alexandre Alapetite
506fe3f44c Fix extensions i18en English fallback (#5752)
fix https://github.com/FreshRSS/FreshRSS/issues/5734
fix https://github.com/FreshRSS/FreshRSS/issues/5724
Regression from https://github.com/FreshRSS/FreshRSS/pull/5426
2023-10-27 09:57:39 +02:00
NaeiKinDus
ed07055ace fix(minz): fix malformed HTTP header (#5699) 2023-10-11 22:36:15 +02:00
Alexandre Alapetite
13a1c412df Minor update dependencies (#5693)
* Minor update dependencies
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/5691
Mostly dev dependencies; nothing that affects our runtime

* Update versions for GitHub Actions

* Fix newly found typos

* Fix exclude path
2023-10-08 20:19:17 +02:00
Sam Cohen
52d87c3eaa Allow configuration of Base URL via website (#5656)
* Allow configuration of Base URL via website

* Fix alphabetization of CREDITS

* Apply suggestions from code review

* Add Automatic recommendation

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-09-13 22:58:10 +02:00
Alexandre Alapetite
1c7c1016f4 Fix JSON export/import (#5626)
* Fix import with empty content
fix https://github.com/FreshRSS/FreshRSS/issues/5622
Cherry picks on https://github.com/FreshRSS/FreshRSS/pull/5584

* Fix export of tags / labels
Article-defined tags were wrongly exported as user-defined labels.

* Fix export of tags / labels
Article-defined tags were wrongly exported as user-defined labels.

* Fix bug with many labels

* Better typing

* Comments
2023-09-04 10:09:37 +02:00
Alexandre Alapetite
e7689459f2 Rework trusted proxies (#5549)
* Rework trusted proxies
Fix https://github.com/FreshRSS/FreshRSS/issues/5502
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/3226

New environment variable `TRUSTED_PROXY`: set to 0 to disable, or to a list of trusted IP ranges compatible with https://httpd.apache.org/docs/current/mod/mod_remoteip.html#remoteiptrustedproxy

New internal environment variable `CONN_REMOTE_ADDR` to remember the true IP address of the connection (e.g. last proxy), even when using mod_remoteip.

Current working setups should not observe any significant change.

* Minor whitespace

* Safer trusted sources during install
Rework of https://github.com/FreshRSS/FreshRSS/pull/5358
https://github.com/FreshRSS/FreshRSS/issues/5357

* Minor readme
2023-07-30 12:59:18 +02:00
Luc SANCHEZ
7f9594b8c7 fix many "Only booleans are allowed in an if condition" (#5501)
* fix many "Only booleans are allowed in an if condition"

* Update cli/create-user.php

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

* Update cli/i18n/I18nUsageValidator.php

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

* Fix several regressions and other minor things

* Fix another regression

* Update lib/http-conditional.php

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

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-07-07 21:53:17 +02:00
Alexandre Alapetite
1db606bc1b New extension hook entry_auto_read (#5505)
* New extension hook entry_auto_read
For extensions to be notified of articles being automatically marked as read for various reasons

* Documentation + entry_auto_unread
2023-07-05 11:00:26 +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
2f5ef39cf2 Remove core extensions Google Groups and Tumblr (#5457)
* Remove core extensions Google Groups and Tumblr
* Google Groups seems to have remove support for RSS/ATOM https://github.com/FreshRSS/FreshRSS/pull/2838 (see e.g. https://www.theregister.com/2021/08/16/google_groups_rss/ )
* Tumblr seems to have fixed their RSS/ATOM post-GDPR https://github.com/FreshRSS/FreshRSS/pull/1924

So for both of thems, the extensions have become irrelevant.

* Cleaning
2023-06-12 08:22:02 +02:00
Luc SANCHEZ
8f0a121e6a phpstan-8 typehinting (#5429)
Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
2023-05-30 21:34:42 +02:00
Alexandre Alapetite
0292b2f1f3 Improve Dev Container (#5423)
* Improve Dev Container
PHPStan was failing in Dev Container

* Update Docker to Alpine Linux 3.18
* New DATA_PATH environment variable

* README
2023-05-28 18:03:34 +02:00
maTh
eeefbdf9c7 Fixed: i18n extensions: 'en' as fallback (#5426)
* Update Translate.php

* Small improvements

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-05-28 18:02:04 +02:00
vrachnis
df80913747 Fix favicon fetching while using proxies (#5421)
* Fix favicon fetching while using proxies

This ensures that if curl_options are defined in config.php, those
settings are respected while fetching favicons.

Fixes FreshRSS#4951

* Change options priority

* Credits keep alphabticorder

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-05-25 09:27:52 +02:00
Alexandre Alapetite
445cc23abd PHPStan Level 7 complete (#5406)
* PHPStan Level 7 complete

* Start PHPStan Level 8

* Forgot exclude .phtml
2023-05-22 20:55:59 +02:00
Alexandre Alapetite
2038d50110 PHPStan Level 7 for Minz_Request, FreshRSS_Feed, Minz_Error (#5400)
* PHPStan Level 7 for Minz_Request

* PHPStan Level 7 for FreshRSS_Feed

* PHPStan Level 7 for Minz_Error
2023-05-15 19:26:48 +02:00
Alexandre Alapetite
c8d2ead763 Fix logs pagination (#5403)
* Fix logs pagination
Regression from https://github.com/FreshRSS/FreshRSS/pull/5269

* Add better default
2023-05-15 15:21:17 +02:00
Alexandre Alapetite
d8c535c25c PHPStan Level 7 for Share userController logs_pagination (#5393) 2023-05-13 22:47:51 +02:00
Alexis Degrugillier
68766a9857 Link configuration to proper parameter (#5394)
Before, the system configuration was linked to the user parameter while the
user configuration was linked to the system parameter. This was an issue when
trying to retrieve some kind of configuration value in an extension.
Now, the configurations are properly linked to their parameters.
2023-05-12 23:02:25 +02:00
Alexandre Alapetite
4b2a94453f PHPMailer 6.8.0 (#5389)
* PHPMailer 6.8.0
https://github.com/PHPMailer/PHPMailer/releases/tag/v6.8.0
https://github.com/PHPMailer/PHPMailer/releases

* Exclude unused DSNConfigurator
2023-05-11 13:08:49 +02:00
Alexandre Alapetite
6e2f2f1c1e A few additional PHPStan rules (#5388)
A subset of
https://github.com/phpstan/phpstan-strict-rules
2023-05-11 13:02:04 +02:00
Alexandre Alapetite
fe7d9bbcd6 Typed view model classes (#5380)
* Typed view model classes
* Add ability to provide a typed view model class to a controller
* Use `::class` instead of string for referring to classes
* Examplified with `stats` and `javascript` controllers / views (more to do)
* Also useful for extensions (my usecase today), which did not have the ability to define own view model attributes before.

* Typo
2023-05-11 12:53:32 +02:00
maTh
54c8de86c7 docs: language table added (#5375)
* docs: language table added

* Update 05_Configuration.md

* Update 05_Configuration.md

* french docs

* Unicode quote and a few fixes
(Same search&replace aslo applied to a few other files)

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-05-07 21:35:08 +02:00
Alexandre Alapetite
30c69ef147 Use PHPStan dynamicConstantNames (#5370)
https://phpstan.org/config-reference#constants
Avoid a few phpstan-ignore-next-line
2023-05-04 19:47:54 +02:00
Alexandre Alapetite
0a38aa7456 Automatic trusted_sources during install (#5358)
* Automatic trusted_sources during install
Fix https://github.com/FreshRSS/FreshRSS/issues/5357

* Fix install for http_auth

* Update lib/lib_rss.php

Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com>

* Fill null exception e-mail

* Revert some syntax

* Minor parentheses
2023-05-03 00:37:04 +02:00
Alexandre Alapetite
c72914bba2 PHPStan Level 7 for more DAO PDO (#5328)
* PHPStan Level 7 for more DAO PDO
With new function to address common type and check problems

* A bit more

* PHPStan Level 7 for FreshRSS_Entry
2023-04-28 14:01:11 +02:00
Alexandre Alapetite
5579dc88ab Better XPath failure (#5317)
Report feeds as errored for more cases
2023-04-20 08:21:37 +02:00
Alexandre Alapetite
ecd956c736 PHPStan 7 configureController (#5318)
And fix bugs for saving user queries
2023-04-20 00:55:10 +02:00
Alexandre Alapetite
ef82e218ea PHPStan Level 7 Minz_ActionController and lib_date (#5313) 2023-04-19 09:16:48 +02:00
Alexandre Alapetite
687d0b40a8 Fix safe_ascii (#5311)
Fix https://github.com/FreshRSS/FreshRSS/issues/5310
2023-04-17 19:53:54 +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
b3121709d6 PHPStan Level 6 FreshRSS_Search FreshRSS_Entry (#5292)
* PHPStan Level 6 FreshRSS_Search FreshRSS_Entry

* Minor fix

* Type fix

* Apply suggestions from code review

Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com>

* Minor types syntax
Compatibility Intelephense

---------

Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com>
2023-04-14 14:23:45 +02:00
Luc SANCHEZ
6e7fa07a39 PHPstan level 6 for Dispatcher.php (#5290)
* PHPstan level 6 for Dispatcher.php

* PHPstan level 6 for Dispatcher.php

* Minor fixes

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-04-12 13:11:28 +02:00
Luc SANCHEZ
594d118bc4 PHPstan level 6 for Migrator.php (#5283)
* PHPstan level 5 for Migrator.php

* PHPstan level 5 for Migrator.php

* Update lib/Minz/Migrator.php

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

* Update lib/Minz/Migrator.php

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

* Update lib/Minz/Migrator.php

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

* Update lib/Minz/Migrator.php

* Update lib/Minz/Migrator.php

* Fix type

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-04-11 13:39:04 +02:00
Luc SANCHEZ
03129a2ee7 PHPStan for Minz_Session class (#5282)
* PHPstan level 8 for Session.php

* PHPstan level 8 for Session.php

* PHPstan level 8 for Session.php

* Update lib/Minz/Session.php

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

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-04-10 22:35:40 +02:00
Alexandre Alapetite
90bf0ecd81 PHPStan 9 for lib/http-conditional.php (#5277)
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112
2023-04-10 12:42:06 +02:00
Alexandre Alapetite
743ca371bb PHPStan Level 6 for more files (#5275)
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112
2023-04-08 17:37:42 +02:00
Alexandre Alapetite
b6ac505f8f Fix login (#5271)
Fix https://github.com/FreshRSS/FreshRSS/issues/5270
2023-04-07 16:12:03 +02:00
Alexandre Alapetite
dbbae15a84 Remove ConfigurationSetter (#5251)
This class has not been maintained for a while. Only a subset of our configuration properties are there, and some code is not relevant anymore. Furthermore, it is relying exclusively on dynamically invoked functions, making it challenging to maintain, in particular to find out what is used and what is not, what is handled and what is not.
It is not well suited for changes in data formats, which have been handled in the Context class instead.
It is also not able to handle configuration properties that are missing.
It is the class with most errors for PHPStan level 6 (179 errors). It is also making intense use of is_callable and call_user_func_array, which are performance killers.
Should the need arrise again to perform validation of our internal configuration files, I suggest an implementation with the opposite approach, namely driven by our code instead of driven by the data.
In summary, at the moment, this class is costly, while not offering many guarantees.
2023-04-07 12:40:43 +02:00
Luc SANCHEZ
d23d10bcde Phpstan Level6 for View.php (#5269)
* 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-07 12:32:10 +02:00
Alexandre Alapetite
6c01e4e7d6 Use typed access to request parameters (#5267)
* Use typed access to request parameters
This was a big source of mixed datatypes in many places

* Fix notifications

* Fix bookmarkAction
2023-04-07 00:13:49 +02:00
Alexandre Alapetite
2118448133 PHPStan level 6 for more files (#5264)
7 more files passing (see phpstan-next.txt)
2023-04-05 23:26:38 +02:00