Commit Graph

224 Commits

Author SHA1 Message Date
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
Alexandre Alapetite
723f7577d0 Refactor lastSeen and markReadAsGone (#5470)
* Refactor lastSeen and markReadAsGone
Make the logic a bit more robust and explicit

* Remove forgotten SQL param

* Add test inTransaction

* More robust transaction

* Add a debug log

* Add max timestamp to markAsReadUponGone

* Reduce number of debug lines

* typing

* Better detection of when feed is empty

* More explicit case for push
2023-06-16 16:11:16 +02:00
Alexandre Alapetite
ea503975d5 Fix again updateLastSeenUnchanged (#5404)
* Fix again updateLastSeenUnchanged
https://github.com/FreshRSS/FreshRSS/pull/5382 was not good enough to fix markAsReadUponGone and introduced a regression in `entry.lastSeen`.
New approach.
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/5315

* Minor change of mind

* Fix handling of lastSeen
entry.lastSeen was not always correctly initialised, and sometimes overriden
2023-05-16 12:09:39 +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
4c5f3bbd9b Fix markAsReadUponGone (#5382)
Fix regression from https://github.com/FreshRSS/FreshRSS/pull/5315
which indroduced a bug for cached feeds.
We now update the `lastSeen` property of entries to account for the fact that they are unchanged but still existing.
2023-05-09 22:31:43 +02:00
Luc SANCHEZ
f90cd8042c phpstan level 7 for feedController.php (#5373)
* phpstan level 7 for feedController.php

* phpstan level 7 for feedController.php

* phpstan level 7 for feedController.php

* phpstan level 7 for feedController.php

* A few fixes

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-05-07 21:09:56 +02:00
Alexandre Alapetite
bd9fa803f1 PHPStan Level 7 complete DAOs (#5354)
* 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-05-02 14:38:32 +02:00
Alexandre Alapetite
8abe53d879 Improve markAsReadUponGone (#5315)
* Improve markAsReadUponGone
Fix case  when the uptream feed has zero article, then old articles would never be automatically marked as read with the "mark as read when gone" policy, which was only based on the timestamp of new articles from the uptream feed.

* Fix typo

* Simplify request
Needs to be re-tested with SQLite + MySQL

* While waiting to check syntax on all database types

* Fix multiple errors
In the case of WebSub, and in the case of invalid GUIDs
2023-04-20 21:46:25 +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
74bf894db0 PHPStan 6 for remaining controllers (#5279)
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112
2023-04-10 12:41:38 +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
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
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
Alexandre Alapetite
4e2bbf820a Fix addFeed (#5253)
Fix https://github.com/FreshRSS/FreshRSS/issues/5252
Regression from https://github.com/FreshRSS/FreshRSS/pull/5239
2023-04-03 09:46:04 +02:00
Alexandre Alapetite
288ed04ccc PHPStan level 6 for all PDO and Exception classes (#5239)
* PHPStan level 6 for all PDO and Exception classes
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112

* Fix type

* Now also our remaining own librairies

* Motivation for a few more files

* A few more DAO classes

* Last interface
2023-03-31 08:23:39 +02:00
Alexandre Alapetite
e750448f5b Consistent entry ID type (32-bit compatibility) (#5213)
* 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-22 09:57:31 +01:00
Alexandre Alapetite
05ae1b0d26 XML+XPath (#5076)
* 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-09 13:57:20 +01:00
Alexandre Alapetite
64d68a691c Fix disabling proxy (#5082)
#fix https://github.com/FreshRSS/FreshRSS/issues/5081
Allow disabling curl proxy for specific feed, when proxy is defined globally
2023-02-08 17:52:51 +01:00
Alexandre Alapetite
9b5de54a9c Remove -x on some files not needing it (#5065) 2023-02-03 14:34:47 +01:00
Alexandre Alapetite
8f9c4143fc Better enclosures (#4944)
* Better enclosures
#fix https://github.com/FreshRSS/FreshRSS/issues/4702
Improvement of https://github.com/FreshRSS/FreshRSS/pull/2898

* A few fixes

* Better enclosure titles

* Improve thumbnails

* Implement thumbnail for HTML+XPath

* Avoid duplicate enclosures
#fix https://github.com/FreshRSS/FreshRSS/issues/1668

* Fix regex

* Add basic support for media:credit
And use <figure> for enclosures

* Fix link encoding + simplify code

* Fix some SimplePie bugs
Encoding errors in enclosure links

* Remove debugging syslog

* Remove debugging syslog

* SimplePie fix multiple RSS2 enclosures
#fix https://github.com/FreshRSS/FreshRSS/issues/4974

* Improve thumbnails

* Performance with yield
Avoid generating all enclosures if not used

* API keep providing enclosures inside content
Clients are typically not showing the enclosures to the users (tested with News+, FeedMe, Readrops, Fluent Reader Lite)

* Lint

* Fix API output enclosure

* Fix API content strcut

* API tolerate enclosures without a type
2023-01-06 19:53:43 +01:00
Alexandre Alapetite
5897487f2f Fix path_entries encoding (#4823)
* Fix path_entries encoding
#fix https://github.com/FreshRSS/FreshRSS/issues/4815

* Fix preview
2022-11-07 08:34:12 +01:00
Alexandre Alapetite
648a876d77 Add support for custom XPath date/time format (#4703)
* 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-09 15:43:30 +02:00
Chris Francy
6dc611db2b Fix show settings page after adding new feed (#4612) (#4631) 2022-09-20 10:41:36 +02:00
Roman D
0ec65788f9 Implemented advanced feed settings to allow cookies and HTTP redirects. (#4470)
* Implemented advanced feed settings to allow cookies and HTTP redirects.

* i18n fr

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-08-20 12:06:24 +02:00
Alexandre Alapetite
1603c10bba XPath ability to define the UID manually (#4507)
* XPath ability to define the UID manually

* Fix error in i18n
2022-08-18 12:10:55 +02:00
papaschloss
8587efa621 Article css filtering (#4501)
* Update feedController.php

* Update subscriptionController.php

* Update DatabaseDAO.php

* Update Entry.php

* Update Feed.php

* Update FeedDAO.php

* Update install.sql.mysql.php

* Update install.sql.pgsql.php

* Update install.sql.sqlite.php

* Update sub.php

* Update opml.phtml

* Update ImportService.php

* Update update.phtml

* Update feed.js

* Update install.sql.mysql.php

* Update install.sql.pgsql.php

* Update install.sql.sqlite.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update sub.php

* Update FeedDAO.php

* Update feedController.php

* Update subscriptionController.php

* Update Entry.php

* Update Feed.php

* Update feedController.php

* Update subscriptionController.php

* Update ImportService.php

* Update opml.phtml

* Update update.phtml

* Update update.phtml

* Update update.phtml

* Update DatabaseDAO.php

* Update app/Models/Entry.php

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

* Update app/i18n/fr/sub.php

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

* Update p/scripts/feed.js

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

* Update app/Controllers/feedController.php

* make fix-all

* Update documentation

* css_path_filter help message

* i18n en-us ignore

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-08-15 21:01:18 +02:00
Alexandre Alapetite
82ac1d1e67 Refactor entry-to-GReader API format (#4490)
* Refactor entry to GReader API format
Some code was copied in two locations and not completely uniform.
Cleaning of related variables and functions (e.g. better types for entries and categories as objects vs. as IDs).
Usecase: I need to call the same GReader-compatible serialization from an extension

* Fixed some edge cases

* Keep summary instead of content
`summary` and `content` seems to be used interchangeably in the Google Reader API. We have been using `summary` for our client API and  `content` in our export/import, so stick to that.
2022-08-08 12:04:02 +02:00
Alexandre Alapetite
0866fdaee8 Add database field attributes for entries (#4444)
* Add database field attributes for entries
Just like we already have for categories, feeds, etc.
No core use yet, but allows in particular extensions to save per-entry data

* Fix PHPStand

* Fix wrong variable
2022-07-19 15:17:08 +02:00
Alexandre Alapetite
509c8cae63 Dynamic OPML (#4407)
* 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-07-04 09:53:26 +02:00
Alexandre Alapetite
d785ddde2a New option to automatically mark as read gone articles (#4426)
* New option to automatically mark as read gone articles
Option to automatically and immediately mark as read entries / articles that are no longer provided in their upstream RSS / ATOM / XPath feed

* Reduce SQL queries
Optimisation: Perform cache update only once
2022-06-25 11:15:51 +02:00
Alexandre Alapetite
07a52137a9 Fix last update & archive logic (#4422)
#fix https://github.com/FreshRSS/FreshRSS/issues/4401
2022-06-25 11:11:23 +02:00
Alexandre Alapetite
f5aaf5f460 New limit option when reloading a feed (#4370) 2022-05-19 21:30:40 +02:00
Alexandre Alapetite
7f0c378482 Fix favicons update (#4358)
Better update the favicons when the URL changes
2022-05-13 23:14:09 +02:00
Clemens Neubauer
046598e743 fix depending results after changing value of "entry->isRead" (#4331)
* fix depending results after changing value of "entry->isRead" inside of hook 'entry_before_insert'

if anybody use the hook 'entry_before_insert' and change the value of the property 'entry->isRead', the depending results are correct now.

In my case my config let all new entrys as "isRead=FALSE" as i will. A new extension which is in progress, can/should/must change the value of this property, but the depending results of this property are wrong before this fix.

* Update app/Controllers/feedController.php

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-04-26 08:47:19 +02:00
maTh
7d00ad8ed7 Improve: manage feed in view within a slider (#4226)
* 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-03-22 23:09:50 +01:00
Alexandre Alapetite
4363e13c34 Set feed error state when XPath does not match (#4275)
Gives the ability to filter HTML+XPath feeds that are not working
2022-03-21 12:51:41 +01:00
Alexandre Alapetite
1fe66ad020 Implement Web scraping "HTML + XPath" (#4220)
* 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 e49c578817

* SimplePie upstream PR merged
https://github.com/simplepie/simplepie/pull/723
2022-02-28 20:22:43 +01:00
maTh
fa23ae76ea fix (#4240) 2022-02-27 22:43:53 +01:00
Alexandre Alapetite
ede82f9819 Fix read-when-same-title bug (#4206)
Made apparent by type hints
2022-02-07 01:03:00 +01:00
Alexandre Alapetite
1c5cf71859 Fix Fever 32 bit ID issue + more PHP type hints (#4201)
* Fix Fever 32 bit ID issue + more PHP type hints
#fix https://github.com/FreshRSS/FreshRSS/issues/4200
Follow up and fix regression from https://github.com/FreshRSS/FreshRSS/pull/4110

* More PHP type hints with PHPStan

* Fix pull problem

* Avoid more nulls
2022-02-06 14:31:36 +01:00
Alexandre Alapetite
1acd3ab09b Use typographic quotes (#4133)
* Use typographic quotes

* A few fixes

* Fix

* Fix not saved

* Implement feedback

* Detail

* Revert spoken English fixes
Left for a future dedicated discussion

* More reverts

* Final reverts

* Final minor
2022-01-08 21:58:55 +01:00