Commit Graph

32 Commits

Author SHA1 Message Date
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 1fb0cdfd06
Unicode preg_split new line (#6247)
fix https://github.com/FreshRSS/FreshRSS/issues/6236
https://php.net/reference.pcre.pattern.modifiers
2024-03-31 18:39:43 +02: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 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 a3ed826913
Remove variable default_category (#5945)
Not really used, and causing bug in https://github.com/FreshRSS/FreshRSS/pull/5942

```
Fatal error: Uncaught Error: Typed property FreshRSS_View::$default_category must not be accessed before initialization in /var/www/FreshRSS/app/views/helpers/category/update.phtml:218 Stack trace: #0 /var/www/FreshRSS/lib/Minz/View.php(93): include() #1 /var/www/FreshRSS/lib/Minz/View.php(143): Minz_View->includeFile() #2 /var/www/FreshRSS/app/views/category/update.phtml(9): Minz_View->renderHelper() #3 /var/www/FreshRSS/lib/Minz/View.php(93): include('...') #4 /var/www/FreshRSS/lib/Minz/View.php(115): Minz_View->includeFile() #5 /var/www/FreshRSS/lib/Minz/View.php(75): Minz_View->render() #6 /var/www/FreshRSS/lib/Minz/Dispatcher.php(59): Minz_View->build() #7 /var/www/FreshRSS/lib/Minz/FrontController.php(61): Minz_Dispatcher->run() #8 /var/www/FreshRSS/p/i/index.php(59): Minz_FrontController->run() #9 {main} thrown in /var/www/FreshRSS/app/views/helpers/category/update.phtml on line 218
```
2023-12-14 22:11:04 +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 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
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
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
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 115724622f
PHPStan Level 7 for ten more files (#5327)
* PHPStan Level 7 for nine more files

* Minor syntax

* One more
2023-04-23 11:58:15 +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 ab49ee6c0c
Increase time limit import OPML (#5231)
Importing an OPML file can take a long time.
While waiting for a better way to customize, let's give it more time, like other slow functions
2023-03-28 14:24:36 +02: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
berumuron daaa391e33
tec: Update the lib_opml (#4403)
* 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>
2023-01-18 10:12:21 +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
Alexandre Alapetite 0c472402f2
Workaround invalid OPMLs (#4591)
* Workaround invalid OPMLs
#fix https://github.com/FreshRSS/FreshRSS/issues/4590
Accept OPML files lacking text attributes

* Tolerate missing head element
2022-09-09 22:56:34 +02:00
Luc SANCHEZ 85991d1c5c
Use keyword "static" (#4436)
static closure
2022-08-21 22:41:31 +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 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 4a87206f28
OPML export/import of some proprietary FreshRSS attributes (#4342)
* OPML export/import of some proprietary FreshRSS attributes
#fix https://github.com/FreshRSS/FreshRSS/issues/4077
And one of the TODOs of https://github.com/FreshRSS/FreshRSS/pull/4220
XPath options, CSS Selector, and action filters

* Bump library patch version

* OPML namespace + documentation

* Add example
2022-05-12 22:15:10 +02: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
Thomas Renes 916df412f5
Fix various typos and spelling errors in documentation, comments and code. (#4134) 2022-01-08 16:25:17 +01: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
Luc SANCHEZ 7b15ffc838
Rename variable (#3867)
Variable is more explicite now $ok to $isOkStatus
2021-10-14 13:32:58 +02:00
Alexandre Alapetite de40f3ad56
Fix TT-RSS import (#3553) 2021-03-24 19:04:51 +01:00
Alexandre Alapetite 4a87f34bcf
API implement OPML import/export (#3424)
#fix https://github.com/FreshRSS/FreshRSS/issues/3421
2021-02-06 12:43:30 +01:00