Commit Graph

1004 Commits

Author SHA1 Message Date
PeterVavercak
ee7eb67f3c Implement sort order per feed (#8234)
* added local feed sorting

Addresses https://github.com/FreshRSS/FreshRSS/issues/4761

- Added number of sorted feeds and associative array for feed sorting option in Context.
- Number of sorted feeds and local sorting option by its index saved into Minz Request Parameters.
- Number of sorted feeds and local sorting options deleted when choosing another Option Of Global Sorting.
- Added option of allowing sorting by feed in configuration.
- Added variable for allowing local sorting in userConf.
- Added function to get feeds by current get in context.
- Added menu button for all individual feed sorting.
- New database options for individual feed sorting in EntryDAO.
- Considered choosing new entries based on chosen load limit.
- Local sorting parameter saved into continuation value in Index Controller.

How to test the feature manually:

1. At the bottom of Reading Configuration menu turn on individual sorting option menu 
2. Choose Sorting by feed option
3. Choose feed at next sorting menu and choose sorting option for that feed

* added feed sorting option

* added sort feeds display

* added template for sort feed name

* added title to feed sorting button

* added comments

* added local sorting option

* Added Docs

* css reset

* added getter and seter for local sort

* added getter and seter for local sort

* allowed sorting per feed

* allowed sorting per feed

* added sorting option for category

* deleted changes from NetryDAO

* add setting up sorting for category

* docs reset

* i18 reset

* updated i18 for category

* added i18 for categories

* added i18 for category

* added setting sorting for feeds and category

* removing userConf.allow-local-sort

* removing userConf.allow-local-sort

* removing white space

* added credits

* removed feeds_by_get

* removed whitespace

* changed escaping for values

* added escaping to user set values

* added in_array

* added secondary sort and order

* added secondary sort and order

* fixed readme

* removed whitespace change

* reseted i18n

* added translations

* added feed setting translations

* fixed i18n

* fixed i18n

* changes in sort order per feed

* changes in sort order per feed

* added secondary sort order

* primary sort

* changed to preferred sort order

* i18n

* Revert wrong whitespace changes

* Re-order new options

* added blank option

* fixed escaping

* fixed default sort in feed

* fixed default sort recovery

* siplyfied option

* added rand option

* Revert unrelated change

* Minor plaintext

* Whitespace and formatting fixes

* Avoid unneeded SQL requests and processing

* Improve syntax

* Improve logic

* Reuse existing translations as much as possible

* i18n

* Remove some options that make little sense

* Separators

* Fix old transation key

* Add help messages

* Progress on secondary sort

* raw name

* Pass parameters. Add TODO

* Progress

* Minor ordering

* Fix parenthesis

---------

Co-authored-by: root <root@LAPTOP-C8TCHHPN.localdomain>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-02-01 13:12:47 +01:00
Alexandre Alapetite
dae27ebd5d Fix wrong search toString in case of regex-looking string (#8479)
`author:'/u/Alice'` was missing its quotes during serialisation, transforming it to a regex.
2026-02-01 13:06:18 +01:00
rupak
b59a2101b4 Add option to enable notifications (#8458)
Closes https://github.com/FreshRSS/FreshRSS/issues/7330

- Default behavior is same
- Added FreshRSS_Context::userConf()->html5_disable_notif so that, it determines weather user wants notification. (will not show any even it has permission) (i want default false so disable, so old configs get proper default values)
- Added button such that checking it makes it request permission too 
<img width="707" height="119" alt="image" src="https://github.com/user-attachments/assets/a0fdbc4d-9f15-4644-8753-f0e6c979677f" />

- test notification actually happening (how can i trigger it, do i have to wait it), this code fixes permissions.
2026-01-29 21:34:35 +01:00
rupak
edc750fe44 pubSub, if hub have same host it can be reached without being public (#8450)
Compares host of hub and baseUrl, to detect they can connect each other ofr pubSubHub

Helps https://github.com/FreshRSS/FreshRSS/issues/8442

Changes proposed in this pull request:

- if host of hub and baseUrl are same then they hub can access freshrss even in localhost

How to test the feature manually:

- Create pubsub server on localhost and connect to RSS instance on localhost.

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-01-29 10:08:08 +01:00
Luca Olivetti
bb786f4ade add allowfullscreen to iframe (#8467)
With the "allowfullscreen" attribute it's possible to view an embedded video in full screen.
2026-01-28 08:28:23 +01:00
rupak
85f14f92fd Message for closed registration (#8462)
* Add closed msg field

i18n

fix

* Display based on registration type

* Save as FreshRSS_Context::systemConf()->closed_registration_message instead

* Improve messages

* Revert unrelated changes

* make fix-all

* Minor whitespace

* Simplify logic

* Fix invalid use of empty() and sympler syntax

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-01-24 15:31:43 +01:00
Alexandre Alapetite
3097abfab6 MariaDB restrict USE INDEX (#8460)
fix https://github.com/FreshRSS/FreshRSS/issues/8455
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/8211
2026-01-24 15:06:59 +01:00
Alexandre Alapetite
7573fee4f0 Fix MySQL transliterator_transliterate fallback (#8427)
The string syntax of `strtr()` cannot handle mutibytes characters, so need to be rewritten using an array map approach.
Extend the fallback replacements to include the Windows/ISO charsets of the latin languages for which we have a translation
2026-01-10 23:38:00 +01:00
Alexandre Alapetite
b0a5f063ab Fix tags ILIKE (#8425)
fix https://github.com/FreshRSS/FreshRSS/issues/8424
Regression from https://github.com/FreshRSS/FreshRSS/issues/8329
2026-01-10 19:14:26 +01:00
Michael Meier
b07ec816b0 Switch to using CURLOPT_ACCEPT_ENCODING instead of the deprecated CURLOPT_ENCODING (#8376)
* Replace deprecated CURLOPT_ENCODING

The CURLOPT_ENCODING setting has been deprecated in favor of
CURLOPT_ACCEPT_ENCODING.

Signed-off-by: Michael Meier <mmeier1986@gmail.com>

* Sync with our SimplePie fork PR
https://github.com/FreshRSS/simplepie/pull/67
https://github.com/simplepie/simplepie/pull/960
https://github.com/simplepie/simplepie/pull/962

* Our SimplePie PR merged

---------

Signed-off-by: Michael Meier <mmeier1986@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-01-03 18:43:15 +01:00
Bartłomiej Dmitruk
26c1102567 Merge commit from fork
* Fix Path Traversal vulnerability in UserDAO methods

* Add tests and changelog for UserDAO path traversal fix

* make fix-all

* Fix PHPStan

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2026-01-03 18:09:44 +01:00
Alexandre Alapetite
2527033057 Fix unwanted expansion of user queries in some cases (#8395)
fix https://github.com/FreshRSS/FreshRSS/issues/8378
2026-01-03 16:52:33 +01:00
Alexandre Alapetite
7c0370b4ea Do not include hidden feeds when counting unread articles in categories (#8357)
fix https://github.com/FreshRSS/FreshRSS/issues/8347
2025-12-27 16:26:02 +01:00
Alexandre Alapetite
6fb5263633 DB: auto-add lastUserModified column also during markRead (#8346)
fix https://github.com/FreshRSS/FreshRSS/issues/8345
2025-12-25 11:31:07 +01:00
Alexandre Alapetite
00c61cf34c Fix serialisation of dates in searches (#8341)
Dates should not be expanded/resolved in string serialisations of search expressions, as it otherwise break relative user queries such as `P30D`.
Fix of https://github.com/FreshRSS/FreshRSS/pull/8293
2025-12-24 01:19:06 +01:00
Alexandre Alapetite
6d57a9de47 Fix parsing of literal "or" in regex (#8338)
fix https://github.com/FreshRSS/FreshRSS/issues/7879
2025-12-23 11:58:51 +01:00
Alexandre Alapetite
1a3912f25a Improve configuration checks (#8334)
Add a distinction between recommended and required extensions.
Add check for recommended php-intl extension as follow-up of https://github.com/FreshRSS/FreshRSS/pull/8329#issuecomment-3677686581
Improve related checks such as ZIP.
Reduce duplicated translations and tests.
2025-12-21 19:26:08 +01:00
Alexandre Alapetite
af1e5cb9bc More uniform SQL search and PHP search (#8329)
* More uniform SQL search and PHP search
The behaviour depends though on the database.
Improve https://github.com/FreshRSS/FreshRSS/discussions/8265#discussioncomment-15278980

* Try to use transliterator_transliterate function instead
2025-12-20 11:06:39 +01:00
Alexandre Alapetite
00cd5df294 Use native PHP #[Deprecated] (#8325)
https://php.watch/versions/8.4/Deprecated
And enfore it with PHPUnit + PHPStan.
Especially useful for extensions.
2025-12-17 10:11:18 +01:00
Alexandre Alapetite
4bd5035914 Rework encoding of search filters (#8324)
Rework:
* https://github.com/FreshRSS/FreshRSS/pull/8222

now that we have:
* https://github.com/FreshRSS/FreshRSS/pull/8293

Follow-up of:
* https://github.com/FreshRSS/FreshRSS/pull/8311

* More simplification

* Deprecate getRawInput
2025-12-17 10:07:52 +01:00
Alexandre Alapetite
6952a13958 Handle null in base64_encode (#8321)
* Handle null in base64_encode
https://github.com/FreshRSS/FreshRSS/discussions/8314#discussioncomment-15269370

* PHPDoc
2025-12-16 18:53:00 +01:00
Alexandre Alapetite
1c50193644 Fix array unique gaps (#8322)
https://github.com/FreshRSS/FreshRSS/discussions/8265#discussioncomment-15270212
2025-12-16 17:52:16 +01:00
Alexandre Alapetite
476e57b046 Reverse hash and nonce (#8320)
Safer password evaluation
2025-12-15 22:06:05 +01:00
Alexandre Alapetite
a8a544a2a2 Fix search encoding and quoting (#8311)
Revised the encoding approach for searches: the HTML encoding is done just before its use for DB search.
Fix also some cases with wrong quoting.
Fix https://github.com/FreshRSS/FreshRSS/pull/8306#issuecomment-3643865439
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/8293
2025-12-13 11:31:34 +01:00
Alexandre Alapetite
394411677e Add functions to modify a search expression (#8293)
* Allows easier modifications of the search expression.
* Add proper `__toString()` instead of just returning the raw input string. Allows in particular showing the result of the actual parsing of the raw input string in the UI.

Needed for https://github.com/FreshRSS/FreshRSS/pull/8294
2025-12-10 22:41:45 +01:00
Alexandre Alapetite
19975c22ec Fix minor backslashes (#8292) 2025-12-07 20:27:06 +01:00
Inverle
6d2bb24b37 Move unsafe autologin to an extension (#7958)
Completes the following TODO https://github.com/FreshRSS/FreshRSS/issues/7923:

de624dc8ce/app/Controllers/authController.php (L105)

Extension PR: https://github.com/FreshRSS/Extensions/pull/364

https://github.com/FreshRSS/Extensions/tree/main/xExtension-UnsafeAutologin
2025-12-04 20:10:20 +01:00
Alexandre Alapetite
78e40c6fe3 Scaling of user statistics (#8277)
Fix https://github.com/FreshRSS/FreshRSS/issues/8268
To better support user management on FreshRSS instance with many users.

SQL speed improved. On a reduced test with 5 users, including some large accounts (PostgreSQL on a very tiny and slow server), improving from ~2.3s to ~1.8s, which gives ~20% speed improvement.

Then tested with 1000 users, with only the default feed (on my old desktop computer):

```sh
for i in {1..1000}; do ./cli/create-user.php --user=freshrss$i --password=freshrss; done
app/actualize_script.php
cli/access-permissions.sh
```

SQLite:

```console
$ time cli/user-info.php | wc -l
1001

real    0m1.366s
user    0m0.908s
sys     0m0.475s
```

PostgreSQL:

```console
$ time cli/user-info.php | wc -l
1001

real    0m28.498s
user    0m12.137s
sys     0m2.217s
```

MariaDB:

```console
# time ./cli/user-info.php | wc -l
1001

real    0m49.485s
user    0m1.276s
sys     0m2.258s
```

Yes, SQLite is much faster - not a surprise for such use-cases, where the TCP connection is not re-used.

I have added some CLI options to disable some statistics:

```sh
cli/user-info.php --no-db-size --no-db-counts
```

For the Web UI, I have disabled detailed user statistics if it takes too long, and retrieve missing user statistics asynchronously via JavaScript. Lazy loading of the user details based on IntersectionObserver, with maximum 10 requests in parallel.
Web UI tested on 1000 users as well. Checked with SeaMonkey.
2025-12-04 19:11:31 +01:00
Inverle
60cf5ea297 Improve anonymous authentication logic (#8165)
* Improve anonymous authentication logic

* forgot to git add

* Fix incorrect token check

Because an empty parameter could be just passed if token for the user wasn't set: `&token=`
2025-12-04 08:46:11 +01:00
Alexandre Alapetite
a50e9a98db Fix MySQL / MariaDB database size calculation (#8282)
The `_` is a special character in the SQL `LIKE` expression and was not escaped, leading to users counting for other users size.
Stats for `freshrss` user included users `freshrss1` and `freshrss2` (but not vice versa).
Discovered during https://github.com/FreshRSS/FreshRSS/pull/8277
2025-12-03 23:43:03 +01:00
dependabot[bot]
6431520ae5 Bump phpstan/phpstan from 2.1.31 to 2.1.32 (#8275)
* Bump phpstan/phpstan from 2.1.31 to 2.1.32

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-version: 2.1.32
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Ignore

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2025-12-02 10:44:39 +01:00
Alexandre Alapetite
023cdf0d7a Web scraping support date format epoch milliseconds (#8266)
fix https://github.com/FreshRSS/FreshRSS/discussions/8264
Auto detect whether a `U` date format should be in seconds or milliseconds.
2025-11-30 21:42:46 +01:00
Alexandre Alapetite
76f5bee76d Better merging of custom HTTP headers (#8251)
Alternative to https://github.com/FreshRSS/FreshRSS/pull/8246
See https://github.com/FreshRSS/FreshRSS/issues/8189#issuecomment-3569434305
2025-11-27 23:31:03 +01:00
Alexandre Alapetite
5e0093aa00 Fix MariaDB updateCachedValues (#8255)
Changed syntax for an even wider compatibility.
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/8254
Regression from https://github.com/FreshRSS/FreshRSS/pull/6957
MariaDB images on Docker Hub go back to 10.6, so changed documentation to indicate support from that version, as I cannot easily test even older versions.
2025-11-26 23:47:29 +01:00
Alexandre Alapetite
b3cfc387b8 Fix MariaDB for updates (#8254)
fix https://github.com/FreshRSS/FreshRSS/issues/8252
regression from https://github.com/FreshRSS/FreshRSS/pull/6957
The current code works with MySQL 8+ (as well as PostgreSQL and SQLite), but not with MariaDB, because MariaDB does not support CTE (Common Table Expression) fully (which I was not aware of)...
2025-11-26 16:47:40 +01:00
Alexandre Alapetite
deb7633c49 Change SQL update query (#6957)
* Change SQL update query for MariaDB / MySQL
fix https://github.com/FreshRSS/FreshRSS/issues/5707

* No change for SQLite

* Fix merge error

* Update MySQL version on the model of PostgreSQL
Performance to be tested

* Fix LEFT JOIN, also for PostgreSQL / SQLite

* Fix alias

* Reduce MySQL deadlock

* Fix compatibility with SQLite

* Back to identical SQL for all databases
2025-11-17 13:48:48 +01:00
Alexandre Alapetite
419a1978b6 Fix MySQL commitNewEntries (#8223)
I just realised that `commitNewEntries()` was not sorting articles properly before insertion in database when using MySQL: Articles were not sorted by publication date as expected from the temporary table before insertion in the final table. MySQL was not picking the correct field, so fixed with an explicit alias.
Discovered because I did some tests with MySQL in https://github.com/FreshRSS/FreshRSS/pull/6957
At the same time, I did the same change for PostgreSQL and SQLite although those were not affected.
2025-11-17 13:46:28 +01:00
Martin Hartmann
b6314bee31 force correct index for MySQL when listing entries (#8211)
* force correct index for MySQL when listing entries

* Make special case for MySQL / MariaDB

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2025-11-15 23:17:13 +01:00
Alexandre Alapetite
45471871dd SQL: Optimise speed of updateCachedValues() (#8207)
For PostgreSQL and SQLite
fix https://github.com/FreshRSS/FreshRSS/issues/8206
2025-11-15 20:11:25 +01:00
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
b6c63d2239 Better transitions between groups of articles (#8174)
fix https://github.com/FreshRSS/FreshRSS/issues/7520
fix https://github.com/FreshRSS/FreshRSS/issues/8168
fix https://github.com/FreshRSS/FreshRSS/discussions/8172
2025-11-04 12:49:21 +01:00
Inverle
7d4854a0a4 Create separate Retry-After files for proxies (#8029)
* Create separate `Retry-After` files for proxies
Bad proxies are able to send a false `Retry-After` header and affect the availability of feeds (domain-wide) for other users.
This PR starts including the address of the proxy if present in filenames for `Retry-After` to mitigate the issue.

* Reduce code changes

* Sync SimplePie fork
https://github.com/FreshRSS/simplepie/pull/62

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2025-11-04 12:48:31 +01:00
scollovati
04c55fa1b8 [sqlite export] add username and timestamp (#8169)
* [sqlite export] add username and timestamp
add username and timestamp to sqlite user export, similar to the ZIP export. Useful for archiving purposes.

* Fix case of backups and other DB types
https://github.com/FreshRSS/FreshRSS/pull/8169#issuecomment-3476079108

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2025-11-02 20:39:41 +01:00
Alexandre Alapetite
49a92c2437 Mark as read 1 or 7 days based on publication date (#8163)
Allow the UI for marking as read articles older than 1 or 7 days to also work when sorting by publication date (in which case, the publication date is used).

<img width="382" height="229" alt="image" src="https://github.com/user-attachments/assets/a630dec8-1e18-4766-8392-59fb593dd73d" />
2025-10-28 19:07:14 +01:00
Alexandre Alapetite
6440f9c9a9 Fix DOM fatal error while filtering retrieved full content (#8161)
https://github.com/FreshRSS/FreshRSS/pull/8132 was not sufficient.
Fix *PHP Fatal error: Uncaught Error: Couldn't fetch DOMElement. Node no longer exists*
2025-10-26 22:35:11 +01:00
dependabot[bot]
f1c91c84dd Bump phpstan/phpstan from 2.1.29 to 2.1.31 (#8156)
* Bump phpstan/phpstan from 2.1.29 to 2.1.31

Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan-phar-composer-source) from 2.1.29 to 2.1.31.
- [Commits](https://github.com/phpstan/phpstan-phar-composer-source/commits)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-version: 2.1.31
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fixes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2025-10-25 11:21:28 +02:00
Alexandre Alapetite
9833d81976 Better SQL auto-update f.kind (#8148)
Add a little help to make sure that feed.kind gets added during the first call.
Tested that replacing the DB with a backup from Febuary 2020 just works, automatically adding new columns since FreshRSS 1.20.0.
2025-10-24 12:49:29 +02:00
Alexandre Alapetite
1282d3a270 PostgreSQL: compatibility with PCRE word boundary (#8141)
Allow the use of regex `\b` for word boundary (and `\B` for the opposite) even when using PostgreSQL.
Follow up of:
* https://github.com/FreshRSS/FreshRSS/pull/6706

For instance, `intitle:/\bnew\B/` will find *newest* but not *new* nor *renewal*.

Useful in particular to minimise the differences between PHP and database in:
* https://github.com/FreshRSS/FreshRSS/pull/7959
2025-10-22 21:21:17 +02: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
Alexandre Alapetite
5909cc5756 Fix DOM error while filtering retrieved full content (#8132)
```
PHP Fatal error: Uncaught Error: Couldn't fetch DOMElement in app/Models/Entry.php:998
```
2025-10-17 15:56:19 +02:00