Commit Graph

264 Commits

Author SHA1 Message Date
Alexandre Alapetite
b2f80ad00a Fix duplicate HTTP header for POST (#7556)
Using POST with JSON would add `Content-Type: application/json` again and again everytime the feed's settings were saved
2025-05-05 18:55:43 +02:00
Alexandre Alapetite
ecdb63c335 Fix regression cURL HTTP headers (#7403)
* 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-03-05 16:45:06 +01:00
maTh
1e8ef4bb72 Improve notifications: notificationName (#7287)
* notificationID

* 3 first examples

* fix

* notificationID -> notificationName

* Update lib/Minz/Request.php

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

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2025-02-02 19:15:03 +01:00
Alexandre Alapetite
22b74b0a57 Improve cURL proxy options (#7231)
3 is now used for CURLPROXY_HTTPS2
f07612cd9a/include/curl/curl.h (L789)
Related to https://github.com/FreshRSS/FreshRSS/issues/7209
2025-01-25 09:14:08 +01:00
Alexandre Alapetite
5368f38753 Reduce undeeded use of elvis operator ?: (#7204) 2025-01-10 08:13:09 +01:00
Alexandre Alapetite
1f466d7a2e Implement custom order-by (#7149)
Add option to sort results by received date (existing, default), publication date, title, URL (link), random.

fix https://github.com/FreshRSS/FreshRSS/issues/1771
fix https://github.com/FreshRSS/FreshRSS/issues/2083
fix https://github.com/FreshRSS/FreshRSS/issues/2119
fix https://github.com/FreshRSS/FreshRSS/issues/2596
fix https://github.com/FreshRSS/FreshRSS/issues/3204
fix https://github.com/FreshRSS/FreshRSS/issues/4405
fix https://github.com/FreshRSS/FreshRSS/issues/5529
fix https://github.com/FreshRSS/FreshRSS/issues/5864
fix https://github.com/FreshRSS/Extensions/issues/161

URL parameters:
* `&sort=id` (current behaviour, sorting according to newest received articles)
* `&sort=date` (publication date, which is not indicative of how new an article is)
* `&sort=title`
* `&sort=link`
* `&sort=rand` (random order - which disables infinite scrolling, at least for now)

combined with `&order=ASC` or `&order=DESC`

![image](https://github.com/user-attachments/assets/2de5aef1-604e-4a73-a147-569f6f42a1be)

## Implementation notes

The sorting criteria by *received date* (id), which is the default, and which was the only one before this PR, is the one that has the best sorting characteristics:
* *uniqueness*: no entries have the exact same received date
* *monotonicity*: new entries always have a higher received date
* *performance*: this field is efficiently indexed in database for fast usage, including for paging (indexing could also be done to other fields, but with lower effective performance)

In contrary, sorting criteria such as by *publication date*, by *title*, or by *link* are neither unique nor monotonic. In particular, multiple articles may share the same *publication date*, and we may receive articles with a *publication date* far in the future, and then later some new articles with a *publication date* far in the past.

To understand why sorting by *publication date* is problematic, it helps to think about sorting by *title* or by *link*, as sorting by *title* and by *publication date* share more or less the same characteristics.

### Problem 1: new articles

New articles may be received in the background after what is shown on screen, and before the next user action such as *mark all as read*. Due to the lack of *monotonicity* when sorting by e.g. *publication date* or *title*, users risk marking as read a batch of articles containing some fresh articles without seeing them.

Mitigation: A parameter `idMax` tracks the maximum ID related to a batch of actions such as *mark all as read* to exclude articles received after those that are displayed.

### Problem 2: paging / pagination

When navigating articles, only a few articles are displayed, and a new "page" of articles needs to be received from the database when scrolling down or when clicking the button to show more articles. When sorting by e.g. *publication date* or *title*, it is not trivial to show the next page without re-showing some of the same articles, and without skipping any. Indeed, views are often with additional criteria such as showing only unread articles, and users may mark some articles as read while viewing them, hereby removing some articles from the previous pages. And like for *Problem 1*, new articles may have been received in the background. Consequently, it is not possible to use `OFFSET` to implement pagination (so the patches suggested by a few users were wrong due to that, in particular).

Mitigation: `idMax` is also used (just like for *Problem 1*) and a *Keyset Pagination* approach is used, combining an unstable sorting criterion such as *publication date* or *title*, together with *id* to ensure stable sorting. (So, 2 sorting criteria + 1 filter criteria)

See e.g. https://www.alwaysdeveloping.net/dailydrop/2022/07/01-keyset-pagination/

### Problem 3: performance

Sorting by anything else than *received date* (id) is doomed to be slow(er) due to the combination of 3 criteria (see *Problem 2*). An `OFFSET` approach (which is not possible anyway as explained) would be even slower. Furthermore, we have no SQL index at the moment, but they would not necessarily help much due to the multiple sorting criteria needed and involving some `OR` logic which is difficult to optimise for databases.

The nicest syntax would be using tuples and corresponding indexes, but that is poorly supported by MySQL https://bugs.mysql.com/bug.php?id=104128

Mitigation: a compatibility SQL syntax is used to implement *Keyset Pagination*

### Problem 4: user confusion

Several users have shown that they do not fully understand the difference between *received date* and *publication date*, and particularly not the pitfalls of *publication date*.

Mitigation: the menus to mark-as-read *before 1 day* and *before 1 week* are disabled when sorting by anything else than *received date*. Likewise, the separation headers *Today* and *Yesterday* and *Before yesterday* are only shown when sorting by *received date*.

Again here, to better understand why, it helps to think about sorting by *title* or by *link*, as sorting by *title* and by *publication date* share more or less the same characteristics.

* [ ] We should write a Q&A and/or documentation about the problems associated to *sorting by publication date*: risks of not noticing new publication, of inadvertently marking them as read, of having some articles with a date in the future hanging at the top of the views (vice versa when sorting in ascending order), performance, etc.

### Problem 5: APIs

Sorting by anything else than *received date* breaks the guarantees needed for a successful synchronisation via API.

Mitigation: sorting by *received date* is ensured for all API calls.
2025-01-06 16:00:00 +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
Luc SANCHEZ
15745d42b7 Upgrade code to php 8.1 (#6748)
* 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-11-28 17:11:04 +01:00
Alexandre Alapetite
aea9ba0d62 New option mark article as read if identical title in category (#6922)
* New mark articles as read if identical title in category
fix https://github.com/FreshRSS/FreshRSS/issues/6143

* i18n todo forgotten
2024-10-21 13:41:16 +02:00
Alexandre Alapetite
f77b45656d Fix add feed with MariaDB / MySQL (#6900)
* Fix add feed with MariaDB / MySQL
fix https://github.com/FreshRSS/FreshRSS/issues/6897
Regression from https://github.com/FreshRSS/FreshRSS/pull/4487

* Type fix
2024-10-15 17:14:50 +02:00
Alexandre Alapetite
b552d9f4bc Fix PHPCS ControlSignature (#6896)
Regression from https://github.com/FreshRSS/FreshRSS/pull/6666
We were not checking anymore for whitespace rules in e.g. `if (true) {`
2024-10-15 10:56:33 +02:00
Alexandre Alapetite
256dcc21bb New unicity policies for feeds with bad GUIDs (#4487)
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-14 09:34:16 +02:00
Alexandre Alapetite
ccb132523a New feed mode: HTML + XPath + JSON dot notation (JSON in HTML) (#6888)
* 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-10-13 15:28:45 +02:00
Alexandre Alapetite
1c09408c64 Fix HTML encodings in e.g. cURL options (#6821)
* Fix HTML encodings in e.g. cURL options

* Trim headers whitespace
2024-09-22 11:05:06 +02:00
Eugen Gorbunov
e9398f3f8c Add HTTP Headers option (#6820)
* 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-21 10:34:38 +02:00
Artur Weigandt
882deab455 Allow SimplePie updates with composer (#4374)
* rename lib/SimplePie to lib/CustomSimplePie

* add test for autoloading SimplePie with PSR-0

* install SimplePie 1.6.0

* Add SimplePie CHANGELOG.md, ignore irrelevant files

* remove unmodified custom classes

* rename all customized SimplePie classes

* Add autoloading for SimplePie PSR-0 and CustomSimplePie classes

* let CustomSimplePie extends SimplePie, remove unchanged code

* let CustomSimplePieMisc extends SimplePie\Misc, remove unchanged code

* Add tests for autoloading

* let CustomSimplePieContentTypeSniffer extends Sniffer, remove unchanged code

* remove unchanged CustomSimplePieEnclosure class

The fixed typos are commited to SimplePie
See 133eac158c

* let CustomSimplePieFile extends SimplePie\File, remove unchanged code

* let CustomSimplePieParser extends SimplePie\Parser, remove unchanged code

* let CustomSimplePieSanitize extends SimplePie\Sanitize, remove unchanged code

* let CustomSimplePieHttpParser extends SimplePie\HTTP\Parser, remove unchanged code

* Remove CustomSimplePie

* Switch SimplePie repo to https://github.com/FreshRSS/simplepie.git

* move to latest branch, update all SimplePie source files

* Use namespaced SimplePie classes, remove SimplePie library folder

* Update to latest SimplePie version with FreshRSS modifications

* Bump SimplePie
Tests expected to fail due to missing a backport of functionalities

* Add fork-specific readme

* Re-implement initial syslog SimplePie GET
https://github.com/FreshRSS/FreshRSS/pull/815
Lacks https://github.com/FreshRSS/FreshRSS/pull/6061

* Closer backport of syslog SimplePie GET
https://github.com/FreshRSS/FreshRSS/pull/6061
But the requests logs will be in the wrong order in case of redirections

* Fixes

* lib update

* SimplePie include a few more files

* Try with cache-hash branch

* Point to newer commit

* Point to newer commit

* Finalise logs

* Finalise

* Bump SimplePie commit

* Bump SimplePie commit

* Readme SimplePie fork

* Bump SimplePie commit

* Better logging

* Bump SimplePie commit

* Reworked approach to work with SimplePie cache
Simpler FreshRSS patches

* Bump SimplePie commit
https://github.com/FreshRSS/simplepie/pull/22

* Simplepie846
https://github.com/FreshRSS/simplepie/pull/23
And additional fixes

* Remove log

* Cherry pick relevant unmerged SimplePie PRs

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-09-14 23:11:10 +02:00
Alexandre Alapetite
dfac9f5813 PHPStan booleansInConditions (#6793)
* PHPStan booleansInConditions

* Uniformisation
2024-09-11 17:14:53 +02:00
Alexandre Alapetite
a81656c3ed Upgrade to PHP 8.1 (#6711)
* Upgrade to PHP 8.1
As discussed in https://github.com/FreshRSS/FreshRSS/discussions/5474

https://www.php.net/releases/8.0/en.php
https://www.php.net/releases/8.1/en.php

Upgrade to available native type declarations
https://php.net/language.types.declarations

Upgrade to https://phpunit.de/announcements/phpunit-10.html which requires PHP 8.1+ (good timing, as version 9 was not maintained anymore)

Upgrade `:oldest` Docker dev image to oldest Alpine version supporting PHP 8.1: Alpine 3.16, which includes PHP 8.1.22.

* Include 6736
https://github.com/FreshRSS/FreshRSS/pull/6736
2024-09-06 09:06:46 +02:00
Alexandre Alapetite
1fad724b95 Improve SQL transactions (#6713)
To avoid some locks.
Fix https://github.com/FreshRSS/FreshRSS/issues/6686
Might be some regressions since https://github.com/FreshRSS/FreshRSS/pull/6632
2024-08-15 21:39:33 +02:00
Alexandre Alapetite
666e7b27ce Fix muted feeds for WebSub (#6671) 2024-07-31 22:11:01 +02:00
Alexandre Alapetite
6e01866845 Fix regression on mark duplicate titles as read for modified articles (#6664)
When the option *mark as read if an identical title already exists in the top n newest articles*, that should not apply to updated articles, as they risk being marked as read due to themselves having the same title.
Identifying the different sub-cases would require a more complicated logic, so disable for now.
Regression due to https://github.com/FreshRSS/FreshRSS/pull/6334
2024-07-30 15:23:46 +02:00
Alexandre Alapetite
5659b37948 Fix markAsReadUponGone regression (#6663)
Regression from https://github.com/FreshRSS/FreshRSS/pull/5470
Was not working anymore when the feed was empty.
Plus simplification of the logic when the feed is not empty
2024-07-30 12:01:59 +02:00
Alexandre Alapetite
0eeac4a669 Revisit keepMaxUnreads (#6632)
* Revisit keepMaxUnreads
Again, follow-up of https://github.com/FreshRSS/FreshRSS/pull/5905
fix https://github.com/FreshRSS/FreshRSS/issues/6620

* Refactoring to address buggy cases

* Fix minor test
2024-07-21 14:54:34 +02:00
Alexandre Alapetite
5b28a35003 Pass PHPStan level 9 (#6544)
* More PHPStan

* More, passing

* 4 more files

* Update to PHPStan 1.11.4
Needed for fixed bug: Consider numeric-string types after string concat
https://github.com/phpstan/phpstan/releases/tag/1.11.4

* Pass PHPStan level 9
Start tracking booleansInConditions

* Fix mark as read

* Fix doctype

* ctype_digit
2024-06-09 20:32:12 +02:00
Luc SANCHEZ
f99c8d5f54 Modernize code to php7.4 (#6043)
* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Modernize code to php7.4

* Consistency

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-06-05 22:04:06 +02:00
Alexandre Alapetite
7d110c23a9 Fix attributeBoolean (#6543)
Regression from https://github.com/FreshRSS/FreshRSS/pull/5946
fix https://github.com/FreshRSS/FreshRSS/issues/6521
2024-06-05 14:26:12 +02:00
Alexandre Alapetite
c0ffc1f720 Fix read_when_same_title_in_feed (#6536)
Fix https://github.com/FreshRSS/FreshRSS/issues/6521
2024-06-04 09:28:58 +02:00
Alexandre Alapetite
44625eed25 Fix CSS selector encoding (#6426)
fix https://github.com/FreshRSS/FreshRSS/issues/6229
fix https://github.com/FreshRSS/FreshRSS/issues/6266#issuecomment-2090432818
2024-05-02 19:49:18 +02:00
Alexandre Alapetite
0e6f56bb4c Fix CSS selector preview (#6423)
fix https://github.com/FreshRSS/FreshRSS/issues/6266

Co-authored-by: maTh <1645099+math-GH@users.noreply.github.com>
2024-05-02 14:13:15 +02:00
Alexandre Alapetite
cd8fc428cb Allow manual refresh of disabled feeds (#6408)
fix https://github.com/FreshRSS/FreshRSS/issues/6407
2024-05-01 23:15:49 +02:00
Alexandre Alapetite
5ca0b893b9 Fix updated entry filters (#6334)
fix https://github.com/FreshRSS/FreshRSS/issues/6331
2024-04-26 13:29:37 +02:00
maTh
154a36700c Refactoring: Rename dotpath into dotnotation (#6369)
* 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-25 08:28:42 +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
d0072b9fb7 Refactor some cURL options and use CURLOPT_USERPWD (#6177)
* Refactor some cURL options and use CURLOPT_USERPWD
fix https://github.com/FreshRSS/FreshRSS/issues/6176

* Fixes
2024-03-10 23:04:17 +01:00
Alexandre Alapetite
bfd277065c Improve feed refresh (#6117)
* Improve feed refresh
Better account for some edge cases for cron and automatic labels
fix https://github.com/FreshRSS/FreshRSS/issues/6089
fix https://github.com/FreshRSS/FreshRSS/issues/6109

* Apply labels also to new entries already marked as read

* Add case most relevant for cron
2024-02-26 09:01:25 +01:00
Alexandre Alapetite
39cc1c11ec New feature: shareable user query (#6052)
* 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-02-26 09:01:03 +01:00
Alexandre Alapetite
2989470e88 applyFilterActions after extensions (#6091)
fix https://github.com/FreshRSS/FreshRSS/issues/6090
2024-02-15 10:31:02 +01:00
Alexandre Alapetite
314077a457 PHPStan prepare exceptions (#6037)
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.
2024-01-15 10:36:30 +01:00
eta-orionis
9c97d8ca72 JSONFeeds, JSON scraping, and POST requests for feeds (#5662)
* 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>
2024-01-10 08:23:45 +01:00
Alexandre Alapetite
70e71b8364 Auto-label (#5954)
Add labels automatically to incoming articles
fix https://github.com/FreshRSS/FreshRSS/issues/2380
fix https://github.com/FreshRSS/FreshRSS/issues/2420
fix https://github.com/FreshRSS/FreshRSS/issues/3279
fix https://github.com/FreshRSS/FreshRSS/discussions/4947
fix https://github.com/FreshRSS/FreshRSS/issues/5728
fix https://github.com/FreshRSS/FreshRSS/issues/5599
2024-01-03 11:23:06 +01:00
Alexandre Alapetite
d65f77c081 More robust assignment of categories to feeds (#5986)
Several minor cases, none of which should really be necessary
Might help:
https://github.com/FreshRSS/FreshRSS/issues/5981
https://github.com/FreshRSS/FreshRSS/issues/5982
2023-12-27 15:18:36 +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
Alexandre Alapetite
6bb45a8726 Add filter actions (auto mark read) at category and global levels (#5942)
* 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-15 23:04:29 +01:00
Alexandre Alapetite
f0d4f2762d Rework keepmax (#5905)
* 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-12-03 19:52:02 +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
VYSE V.E.O
b82c41f6b9 Test if set_time_limit exists (#5675)
* Fix @set_time_limit as @-operator after PHP8 no longer suppresses disabled functions

* preserve @ decorator

* Fix whitespace

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-09-27 21:40:05 +02:00
Alexandre Alapetite
6ee73b5fca Revert auto mark as read same titles for existing articles (#5561)
Partial revert of https://github.com/FreshRSS/FreshRSS/pull/5505
We should not apply the auto mark as read rule based on existing titles for updated articles, because the match would most of the time be on that same article's title.
2023-08-03 21:57:25 +02:00
Alexandre Alapetite
4039f6c9a4 Fix cache refresh (#5562)
Improvement of https://github.com/FreshRSS/FreshRSS/pull/4422

The main problem was due to `touch()` not automatically clearing the file status cache, and requiring a call to `clearstatcache()`. Example:

```
php > touch('/tmp/touch.txt');
php > echo date('c', filemtime('/tmp/touch.txt'));
2023-08-03T17:27:43+02:00
php > touch('/tmp/touch.txt');
php > echo date('c', filemtime('/tmp/touch.txt'));
2023-08-03T17:27:43+02:00
php > clearstatcache(true, '/tmp/touch.txt');
php > echo date('c', filemtime('/tmp/touch.txt'));
2023-08-03T17:28:21+02:00
```
2023-08-03 21:56:35 +02: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
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