Clarify the content retrieval settings in Brazilian Portuguese. The current label asks for a CSS path, which can suggest a stylesheet location. The setting expects a selector such as `.entry-content`. The help text now explains that FreshRSS fetches article content from the original site when the RSS feed provides only part of the text.
Closes#9658
Changes proposed in this pull request:
- Use PostgreSQL `dow` instead of `day` for the day-of-week chart.
- Normalize month repartitions to exactly 12 entries, from January to December.
- Include today in the 30-day chart, anchor the day calculation on the oldest timestamp so integer division is always positive, and return a JSON list.
- Set chart labels and build the average line as an array matching the bar data.
* Fix: corriger les statistiques PostgreSQL
* Remove dead code
---------
Co-authored-by: upskaling <upskaling@users.noreply.github.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Fix#9654
When the subscription page shows only the feeds with errors and a feed is removed from its slider, the redirect went back to the full list. The remove button now keeps `error=1`, and `feed/delete` redirects to the subscription page with `error=1` in that case.
Without `error`, the redirect is unchanged.
How this was checked: I ran FreshRSS 1.31 edge with the PHP built-in server and SQLite, with one feed in error. Before the change, `POST feed/delete` from the error-filtered slider redirected to `?c=subscription`. After the change, it redirects to `?c=subscription&error=1`. Without the error filter, it still redirects to `?c=subscription`. I did not add a PHPUnit test because the action ends in a redirect, and I did not run `make test-all`.
Translate the remaining English text for user-query sorting, the pending WebSub notification, and the existing password length message. These keys are separate from #9655.
* After uncollapsing an article, the first element inside of it will be focused (the title link) for easier Tab navigation.
* All of the links inside entry headers (normal view) now use `tabindex="-1"`, so they can't be focused anymore using Tab. This makes navigation less confusing as there is JS functionality already for moving between articles (i.e. j/k keys) which is the intended way.
* (or s/l for the Share or Labels menu)
* Focus rings are now visible again (removed `outline: none` from CSS for `<a>` elements).
This is mainly for the Normal view, but affects the Reader and Global views too.
Adds a complete Hindi translation in app/i18n/hi/ (all 1,180 strings of the English files, plus plurals.php with nplurals=2; plural=(n > 1)), registers hi in the gen.lang list of every language, and updates the translation table in README.md and README.fr.md.
Co-authored-by: Meer Khurram <199657909+imeerkhurram@users.noreply.github.com>
The Korean translation had 228 entries marked // TODO (falling back to English)
and 14 marked // DIRTY across 9 files. This translates the TODO entries, updates
the DIRTY ones to the current English, and marks three strings that stay the
same in Korean as // IGNORE (the "❌ " error prefix, "Lietuvių" and "URL").
Korean is now at 100% in the README tables.
* Update conf.php - European Portuguese pt-PT translation
Translated just 1 string at line 314
* make fix-all
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Closes#9574
Changes proposed in this pull request:
- `FreshRSS_EntryDAOSQLite::markRead()` now passes arrays of IDs to `FreshRSS_EntryDAO::markRead()`. That method already does a batched `UPDATE … WHERE is_read<>? AND id IN (…)`, split into chunks by `MAX_VARIABLE_NUMBER` (998, which also covers SQLite's parameter limit), then refreshes the unread caches once. For lists of fewer than 6 IDs it still calls back into the existing per-entry SQLite/PostgreSQL path. `FreshRSS_EntryDAOPGSQL` inherits the change.
- The `@param` type now matches the parent's `list<numeric-string>` (PHPStan `argument.type`).
How to test the feature manually:
1. Use PostgreSQL with some latency (`tc qdisc add dev eth0 root netem delay 25ms` on the database host gave about 75 ms per round trip).
2. Mark several hundred unread articles read in a single Google Reader API `edit-tag` request, or call `FreshRSS_Factory::createEntryDao()->markRead($ids, true)` from a CLI script.
3. Compare elapsed time and check that `SUM(cache_nbUnreads)` still equals the unread count in `_entry`.
My results (official `edge` image; the DAO files are identical in 1.30.4):
| Backend | Case | Before | After |
|---|---|---|---|
| PostgreSQL 17, ~75 ms RTT | mark 300 read | 60.5 s | 0.16 s |
| PostgreSQL 17, ~75 ms RTT | resend the same 300 (no change) | 37.6 s | 0.08 s |
| PostgreSQL 17, ~75 ms RTT | mark 2,500 read / unread (chunked) | not run | 0.49 s / 0.49 s |
| SQLite | mark 300 read | 1.48 s | 0.01 s |
| SQLite | mark 2,500 read / unread (chunked) | not run | 0.04 s / 0.04 s |
Unread caches matched the entry table in every case, including lists under 6 IDs and mark-unread. A production instance (PostgreSQL about 100 ms away) has been running the PostgreSQL variant of this change. Reeder on iOS, which had been timing out on every sync, now syncs normally, and `edit-tag` requests finish in under a second.
* SQLite, PostgreSQL: batch markRead for lists of IDs
FreshRSS_EntryDAOSQLite::markRead() handled an array of IDs one entry
per transaction, and FreshRSS_EntryDAOPGSQL inherits it. Delegate
arrays to FreshRSS_EntryDAO::markRead(), whose batched
UPDATE ... WHERE is_read<>? AND id IN (...) is portable, is chunked by
MAX_VARIABLE_NUMBER, and calls back into the per-entry path for small
lists.
Fix https://github.com/FreshRSS/FreshRSS/issues/9574
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Reduce comments
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* PostgreSQL: the owner was never the story, so stop asking who owns the tables
For as long as the install check has existed, it asked pg_tables who owned
the tables and compared that against the database login. Nobody asked why.
The login is a gateway user, the tables belong to whatever role ran the
install, and whenever those two names diverged the check reported the schema
as missing. Visibility was the question all along.
tablesAreCorrect() now asks pg_class which ordinary and partitioned tables
are visible on the search_path. If PostgreSQL can see it, it counts. A table
parked in a schema outside the path does not hide a missing one, and a view
named like a table is not a table.
The new test builds a role, a visible schema, a hidden schema, and a view
with a suspicious name, then checks that each answer is the true one. It runs
against a real PostgreSQL 18 service in CI. Locally it skips unless
FRESHRSS_TEST_PGSQL_DSN is set.
* Pin the CI Postgres service to a digest, because somebody moved the tag
For the record: nobody announced it. The postgres:18-alpine tag sat in
tests.yml like a loaded gun pointed at every CI run, and zizmor was the
first thing to notice it had no fixed identity at all. Remember the
Denver Airport. Remember that tags are not promises.
This commit replaces the mutable tag with the exact multi-arch digest the
suite was already tested against:
postgres:18-alpine@sha256:eaef288f54a90a909e49f0121d5d047a5e974e922699de4249625cf7cde34f36
This is not a version bump. Same image, same PostgreSQL 18, same Alpine
base. The only thing that changed is that the image can no longer be
swapped out from under us between Tuesday's green run and Thursday's
mystery failure.
Verification: all pre-commit PHP, test, JS, CSS and Markdown checks pass.
Local pedantic offline zizmor reports no findings. This resolves the
unpinned-service-image blocker on PR #9535.
* Rewrite test a bit
* Fix make test-all
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Regression from https://github.com/FreshRSS/FreshRSS/pull/9358 (PR not present in current release, stopped sending 403 on failed logins).
This PR fixes the Minz bug mentioned in https://github.com/FreshRSS/FreshRSS/pull/9358#discussion_r4382254359 which occurred with `redirect: false` redirects.
But it also takes a different approach for redirecting, by using HTML instead of the `Location` header (to address one additional issue with a resubmit prompt appearing when refreshing the login page after a failed login).
403 is now returned during failed reauthentication as well.
The GReader API exposes a translated default category name while the database stores Uncategorized. Resolve that name by the constant category ID so marking the category as read accepts the label returned by the API.
Add SQLite regression coverage for English, Russian and French, ordinary Cyrillic category names with spaces, and missing categories.
Fixes#9542
* Add option to open articles on their original website
Clicking an article title can now open the original website instead of the article in FreshRSS. The link icon then opens the article in FreshRSS.
fix https://github.com/FreshRSS/FreshRSS/issues/1954
* i18n: fr
---------
Co-authored-by: Eduardo Coronell <eduardo.coronell@aspsols.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
To get a chance to find out where they come from:
New log:
```
[Thu, 12 Nov 2026 15:28:27 +0000] [warning] --- FreshRSS_Entry::regexMatch Invalid PCRE regex `/\q/`; preg_match(): Compilation failed: unrecognized character follows \ at offset 1; in search: `intitle:/\q/ author:Alice`; first triggered by entry 1731000000123456 of feed 123
```
instead of:
```
PHP Warning: preg_match(): Compilation failed: unrecognized character follows \ at offset 1 in /var/www/FreshRSS/app/Models/Entry.php on line 875
```
* fix: do not double-encode titles and authors when importing JSON
FreshRSS exports titles and authors HTML-encoded, and the JSON import
encoded them again since #9168, so restoring a ZIP export turned
"Post & more" into "Post &amp; more". Decode before encoding.
* Unit test
* Reduce comments
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* feat: add the <enclosure/> field to enhance compatibility with BitTorrent downloaders
Closes#6227
Changes proposed in this pull request:
- Emit an additional RSS 2.0 `<enclosure>` element for BitTorrent attachments in the
generated RSS output (`p/api/query.php?...&f=rss` and the per-feed RSS view).
The existing `<media:content>` output is unchanged.
- Emit it only for `application/x-bittorrent`, `magnet:` and `.torrent` URLs, and skip
images / audio / video. Since 1.24 thumbnails are prepended to the enclosure list, a
naive implementation would duplicate cover images (and podcast media) as attachments.
- Always set `type="application/x-bittorrent"`, and copy `length` when the feed provides it.
- Add unit tests in `tests/app/Views/rssViewTest.php`: torrent, magnet without type,
image attachment skipped.
* fix(rss): emit <enclosure> only for BitTorrent attachments
The previous patch emitted <enclosure> for every enclosure. Since FreshRSS
1.24, thumbnails are prepended to the enclosures list, so cover images and
podcast audio were also duplicated as RSS attachments. Emit the tag only for
application/x-bittorrent, magnet: or .torrent URLs, and always set
type="application/x-bittorrent" so clients such as qBittorrent can use it.
Add three rssViewTest cases: torrent, magnet without type, image skipped.
* Improve regex
* Minor whitespace
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* Fix current password requirement during password changes
Regression from #9358 (follow-up, PR not present in a stable/versioned release)
Fix [GHSA-5vxm-62pg-frff](https://github.com/FreshRSS/FreshRSS/security/advisories/GHSA-5vxm-62pg-frff)
* Remove stale client side bcrypt comment from passwordUtil
* docs: PHP 8.1 is no longer supported
* Minor typographic preference
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Fix the paging bug noticed in #9544.
In the HTML view of a shared user query, the pagination links did not include the `search` parameter, so the user search was lost when going to the next page.
The pagination links now keep the user search (URL-encoded). The common part of the URLs is factored out, using `&` consistently.
Tested locally with a shared query of 60 entries and `search=x`: the second page now only shows matching entries.
* Validate CURLOPT_PROXY format to prevent SSRF allowlist bypass
sanitizeCurlParams() previously only whitelisted cURL option keys and
never validated the CURLOPT_PROXY value itself. httpGet() and the
SimplePie File constructor both strip a scheme from the proxy string
with a greedy preg_replace('#^.*://#', '', $proxy) before running the
host through the internal-host allowlist / DNS-pinning check, but the
*original*, unstripped value is what actually gets handed to cURL.
A proxy value containing a second "://", e.g.
http://127.0.0.1:8080/://8.8.8.8, is reduced by the greedy strip to
the trailing "decoy" host (8.8.8.8) for the allowlist check, while
cURL still connects using the full original string. Depending on how
the installed libcurl parses it, this can route the request to
127.0.0.1:8080 instead of the validated public address.
This adds isSafeProxyString(), a strict format check for
[scheme://][user[:pass]@]host[:port] with no extra path, query,
fragment, or embedded scheme separator, and rejects CURLOPT_PROXY in
sanitizeCurlParams() when it doesn't match. Since every per-feed and
OPML-imported curl_params array is routed through sanitizeCurlParams()
before use (Feed.php, SimplePieCustom.php, ImportService.php), this
single chokepoint covers both the httpGet() and SimplePie fetch paths.
Added regression tests in httpUtilTest.php covering the exploit
payload and a range of legitimate proxy strings (bare host:port,
scheme-prefixed, SOCKS5 with credentials, SOCKS5h host-only).
* Normalise CURLOPT_PROXY scheme once, centrally; drop redundant downstream strips
Per review feedback: now that sanitizeCurlParams() validates CURLOPT_PROXY
and guarantees at most one scheme separator, it also strips that (validated)
scheme once, so the value stored is always scheme-less. This removes the
need for httpGet() and the bundled SimplePie File::curlInit() to each
re-strip the scheme themselves -- both call sites are updated to rely on
the value already being normalised.
Updated the regression tests to assert the normalised value, not just
whether the key survives sanitization.
* Disallow a scheme in CURLOPT_PROXY entirely, per review
CURLOPT_PROXYTYPE is what tells cURL the proxy's scheme -- CURLOPT_PROXY
itself was never supposed to carry one. Rather than validating-then-
stripping a scheme, sanitizeCurlParams() now rejects any CURLOPT_PROXY
value that contains one at all, simplifying isSafeProxyString() and
removing the normalisation step (and its own small regex) entirely.
Trimmed the accompanying comment to the one load-bearing line, and
updated the stale 'strips the scheme' wording in httpGet() and the
SimplePie File::curlInit() comment to 'rejects a scheme-containing
value', matching the simpler behaviour. Updated the regression tests
to match: a scheme-containing value (even a well-formed one) is now
rejected outright instead of being normalised.
* Sync SimplePie
https://github.com/FreshRSS/simplepie/pull/95
* Simplify CURLOPT_PROXY validation to a single str_contains('/') check
Per review (AI-assisted, credited to Inverle): a regex was more than this
needs and had a regression -- it rejected valid IPv6 proxies like [::1]:8080
because their host part contains multiple colons. A proxy value never
legitimately contains a "/": that single check still rejects a scheme
(scheme:// always contains "/") and the original exploit payload, and
additionally blocks a SOCKS Unix-domain-socket path such as
localhost:9050/path/to.sock -- cURL treats that specially for SOCKS
proxies and ignores the port, so an allowlisted host:port could otherwise
be smuggled into connecting to an arbitrary local socket.
Also bumped the vendored SimplePie commit in lib/composer.json now that
the companion fix (FreshRSS/simplepie#95) is merged, and added test
cases for the IPv6 and Unix-socket scenarios.
* Reduce comments
---------
Co-authored-by: S31ZUR3 <191032395+S31ZUR3@users.noreply.github.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
* Use keyed hash (HMAC-SHA256) for favicon cache keys
The favicon cache key was a CRC-32 checksum of the salt-prefixed feed
website URL (or feed icon URL). CRC-32 is linear, so collisions for
equal-length inputs are independent of the salt prefix: a user could
compute offline a website URL for their own feed colliding into
another feed's cache slot, overwrite the shared
data/favicons/<hash>.txt, and have the unauthenticated public favicon
endpoint fetch and serve their image to every user of the instance.
Replace the checksum with a keyed hash (HMAC-SHA256, instance salt as
key, truncated to 16 hex chars) so the cache key cannot be forged
without the secret salt.
* Preserve legacy custom favicons when upgrading cache keys
* Base64 hash (shorter) and native copy
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Inverle <inverle@proton.me>
`FreshRSS_Search::__toString()` did not quote values containing parentheses or the `OR` keyword, so serialising a parsed search and parsing it again could change its structure (e.g. `"a(b"` was serialised as `a(b`).
This makes the serialisation lossless for such values, and adds tests, including a round-trip test (parse → toString → parse).
Closes#9533
- The label configuration panel (`app/views/helpers/tag/update.phtml`) had no "Preview filters on existing articles (new window)" button, unlike the feed, category and global reading settings (the button was added in #7959).
- Add the same button below the auto-labelling filter textarea (`filteractions_label`). It uses the generic `configure/viewFilter` action, as in the global settings, with `filters_name=filteractions_label`.
- Label actions are not scoped to a feed or category: `feedController::applyLabelActions` matches the filter against all new articles. So the generic version, which does not restrict the search with `c:` or `f:`, is the appropriate one.
- The existing translation key `sub.feed.filteractions.view_filter` is reused, so no new translation is needed.
* Support choosing the sort type when creating or editing a user query
Changes
- User queries can now store a sort field (sort type), not only the sort
direction. The create and edit forms expose a single combined dropdown
(field + direction) that reuses the existing `index.menu.sort.*` options,
matching the global reading-settings sort UI.
- The "Bookmark current query" action now also remembers the current sort
field, where it previously kept only the order direction.
- Relabel the query sort control from "Sort by date" to "Sort by"; other
languages are marked for re-translation (// TODO).
- Add a CHANGELOG entry and credit the contributor in CREDITS.
Implementation
- `FreshRSS_UserQuery`: add an optional `sort` property mirroring `order`
(constructor parsing, `toArray()`, `getSort()` falling back to the user
default sort, and a `hasParameters()` check).
- `configureController`: split the combined dropdown value into `sort` and
`order`, validating the field against the implemented sort types
(`id`, `c.name`, `date`, `f.name`, `length`, `link`, `title`, `rand`);
separate `sort`/`order` request parameters are still accepted so the
"bookmark current query" flow keeps working.
- Views render the combined dropdown and persist `sort` as a hidden field.
- `p/api/query.php`: back-fill `sort` from the saved query when the request
does not provide one, mirroring the existing `order` handling.
- Add unit tests covering the sort round-trip and `toArray()` inclusion.
Compatibility
- No database or schema change: user queries are stored in the per-user PHP
config array, which keeps arbitrary keys verbatim, so no migration is
required.
- Upgrade: existing queries without `sort` fall back to the user default
sort; behaviour is unchanged until a sort is explicitly chosen.
- Downgrade: older versions ignore the extra `sort` key and keep working;
re-saving under an old version simply drops the key with no data loss.
- Shared query URLs without a `sort` parameter remain valid.
* Refresh README translation statistics
* i18n: fr
---------
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>