2749 Commits

Author SHA1 Message Date
LaurentGH
a409fb5c1a
Ignore empty keywords in search queries (#277)
When user searches `something SPACE SPACE something`, there is an empty keyword between the two spaces, which has to be ignored.
This also ignores the case of empty queries between double quotes, such as `""` or `" "`, because PostgreSQL Full Text Search does not support them.
2026-03-10 19:52:45 -05:00
supahgreg
ca3174097d
Revert "sanitize content preview (#257)"
This reverts commit cc8380c04d11f1f4830776d42c3063d4ba534c75.
2026-02-11 12:20:56 +00:00
wltb
cc8380c04d
sanitize content preview (#257)
Co-authored-by: wltb <noreply@example.org>
2026-02-10 12:52:17 -06:00
Greg
7c3d372b09
Add 'FORCE_SELF_URL_PATH_USAGE' to allow forcing use of 'SELF_URL_PATH'. (#242)
By default the self URL will still be generated based upon the 'Host' request header.
2026-01-25 16:55:09 -06:00
Greg
2d4c8bdf25
Make the 'Recently read' max age configurable via preference (#236)
* Make the 'Recently read' max age configurable via preference.

Also: don't attempt to filter by unread articles when using the 'Unread' view mode in the 'Recently read' feed.

* Rebase translations.
2026-01-17 11:54:09 -06:00
Greg
2453473835
Treat a feed without articles as valid. (#231)
Prior to this 'DAEMON_UNSUCCESSFUL_DAYS_LIMIT' would disable empty (but otherwise valid) feeds due to 'last_successful_update' not getting set/updated.

Since there might be valid reasons for a feed to be empty, and tt-rss doesn't currently treat such a feed as invalid or surface info that it will be disabled, we'll just treat that situation as a successful update.
2026-01-13 10:53:39 -06:00
supahgreg
5ac9a3a1db
Escape special characters when logging as HTML (e.g. update debugger).
Also wrap 'print_r()' usage in a 'Debug::log()' call to ensure contents get escaped.
2025-12-14 01:02:13 +00:00
supahgreg
15afdeddc0
Bump JS dev dependencies, add some comments. 2025-12-12 19:30:35 +00:00
supahgreg
f15bec24d7
Support '<' and '>' with filters. 2025-12-11 21:30:40 +00:00
supahgreg
b825eef655
forgotpass: fix an undefined key issue, add CSRF protection 2025-12-09 23:59:28 +00:00
LaurentGH
7c66135978
Display FeedParser error instead of the raw feed contents
When subscribing to a feed, if there is a FeedParser error, display the error message instead of the raw feed contents.
2025-12-09 11:22:54 +01:00
supahgreg
d61a2719c6
Only perform extended host validation for server-side fetches.
When DNS is slow, resolution of hosts to IPs can cause a noticeable slowdown when viewing articles/headlines.
2025-11-27 08:41:24 +00:00
supahgreg
5770cc51ba
More ternary operator and ORM usage, assorted tweaks.
Among the 'assorted tweaks' is consistently converting a param to an array of integers.
2025-11-24 03:35:42 +00:00
LaurentGH
bbb075bdaa
Correctly support @yesterday search queries
As indicated in the current help page, searching a date keyword does not work as expected due to UTC comparison.

For example, if the current time is November 18th at 16:14 UTC, then in Japan (GMT+9), it's November 19th at 01:14. A Japanese user who searches for _@yesterday_ means November 18th. However the current implementation uses _strtotime()_ with a default timezone of UTC, so _strtotime("yesterday")_ returns November 17th (because it's still the 18th in UK). There is a time shift after, but it can't solve this first issue. Then, a second issue is related to the conversion of the _updated_ SQL column to a string "YYYY-MM-DD", but there is no time shift.

I choose to fully rewrite this code, using the modern PHP DateTime class, and to use a _true_ Unix timestamp range, instead of a shifted timestamp.
2025-11-20 17:59:45 +01:00
LaurentGH
833c4d279a
Add support for label:{true,false} and tag:{true:false} searches
A search query can now use _label:true_ to find articles with a label, whatever its name is.
A search query can now use _tag:true_ to find articles with a tag, whatever its name is.

This change is straightforward, because more complex queries about label/tag matching were already implemented.

By using two SQL fragments, there is no redundancy in the code.
2025-11-20 11:07:22 +01:00
LaurentGH
6b0c9cf0be
Fix search highlighting of sentences and operators
When a search is performed, the found text should be highlighted.

However:
- successive words are not highlighted because the SQL query with "<->" is used
- operators are highlighted
2025-11-19 08:51:11 +01:00
supahgreg
dab918a426
Switch links from the GitHub project wiki to 'tt-rss.org'. 2025-11-19 02:06:54 +00:00
LaurentGH
f9343e8079
Support simple logical operators in search queries
tt-rss is currently supporting complex text search queries like _( one | two )_.

However, simple queries containing only _!_, _(_ or _)_ were not supported.

This is because the regexp only matched _&_ and _|_.
2025-11-18 12:00:22 +01:00
LaurentGH
fbf91a1f50
In title/author/note searches support spaces to match exact words
A search filter can for example contain spaces such as _title:" be "_.

In this case, the user as explicitly added spaces (instead of using _title:be_), so she clearly indicates her intent to search the word _be_, and not _cyBErspace_.

This patch supports these cases, for keywords title, author and notes.

Also, do a _mb_strtolower()_ globally, because it was in every keyword processing.

Also process the double quoting magic with a consistent regexp in the three needed cases. This change was needed because the previous regexp did not support leading spaces in the value part of a keyword pair.
2025-11-17 14:51:27 +01:00
LaurentGH
816a349d06
Fix a known search issue related to negative note keyword
When a user searches _-note:store_ the results now contains:
- articles with a note different of "store"
- articles with no notes

Indeed, the NULL case was not handled, so articles without a note were not displayed.
2025-11-17 11:28:16 +01:00
LaurentGH
98d7170e8c
Improve the coding style of _search_to_sql() 2025-11-16 18:22:01 +01:00
LaurentGH
2caef4d370
Merge branch 'tt-rss:main' into search-key-to-fulltext 2025-11-16 18:02:31 +01:00
supahgreg
681d04032a
Minor cleanup in 'Pref_Prefs::_get_updated_plugins()' 2025-11-16 16:40:10 +00:00
supahgreg
fbd062a739
Handle plugin update check failures better.
'Pref_Prefs::_plugin_needs_update()' can return null if a plugin directory is a git repo but an issue occurs (e.g. not on an allowed branch, not able to fetch from origin).

Closes tt-rss/tt-rss#171.
2025-11-16 16:17:07 +00:00
LaurentGH
638e28781a
Search the key of an invalid key pair as Full Text Search
A known issue was that the Search Query _title_ was searched using LIKE instead of Full Text Search. It was the same for all keys of an invalid key pair. Solving this suppresses a lot of redundant code.

The Search Queries _start:false_, _pub:false_ and _unread:false_ are now checked.

If the check fails, the SQL error message is bold/strong to be more visible.

The Search Query _@invalid-date_ is now also searched as Full Text Search. Unfortunately, there is no error message, but document it in the source code.
2025-11-16 14:46:57 +01:00
Greg
0ce6f89b7d
Merge pull request #165 from LaurentGH/LaurentGH-search-improvements
Fix bugs in _search_to_sql() and document limitations
2025-11-15 18:58:47 -06:00
supahgreg
a6ce668e97
Order filter rules consistently.
Closes tt-rss/tt-rss#164.
2025-11-15 20:05:10 +00:00
LaurentGH
7cd92c9ab3
The translation of Incorrect search syntax is not need
I tested with the English version, that's why the French message was not visible.

Comments are also simplified.
2025-11-15 14:28:48 +01:00
LaurentGH
2172326172
Fix bugs in _search_to_sql() and document limitations
The function _search_to_sql() processes the query string.

It contained a few bugs.

While analyzing it, I also added comments about the known limitations of this function.
2025-11-15 11:19:37 +01:00
supahgreg
ef8a621941
Adjust 'Pref_Labels' formatting to help xgettext, rebase translations.
Closes tt-rss/tt-rss#162.
2025-11-15 04:03:51 +00:00
LaurentGH
f4416156a1
Improve the call to preg_split to process linefeeds as separators in tags 2025-11-14 19:39:08 +01:00
LaurentGH
e37115ccbe
When adding tags to an article process linefeeds like commas
When a user adds tags to an article, a textarea is used to retrieve the values. The form indicates that tags have to be separated by commas.

However, it is also convenient to separate them by linefeeds. A user can also enter a linefeed thinking it is a separator.

Keeping tags with new lines in the middle is not useful. So, split the string on commas and linefeeds.
2025-11-14 18:23:06 +01:00
supahgreg
63daf4693f
Don't copy default-only preferences when cloning the default profile.
Related to tt-rss/tt-rss#154 and tt-rss/tt-rss#155.
2025-11-13 02:34:18 +00:00
supahgreg
36bbba2eb0
Allow cloning the default profile. 2025-11-13 00:10:21 +00:00
LaurentGH
e63ba6b30f
Old table ttrss_user_prefs still used in Pref_Prefs.php
The table ttrss_user_prefs was replaced by ttrss_user_prefs2 in database version 141.

However, the profile cloning feature still uses twice the old table name, so nothing is really cloned.

The getProfiles() function also uses this old table, so the attribute "initialized" is always false, so there is always "(empty)" at the end of cloned profile names.
2025-11-12 23:07:31 +01:00
supahgreg
03731be009
Allow plugins to provide CSS for Preferences.
Related to #136.
2025-11-09 20:33:30 +00:00
supahgreg
0b8365ed98
Fix various OPML issues related to attribute unavailability. 2025-11-08 02:43:05 +00:00
LaurentGH
07cf550265
Rename Show help dialog to Keyboard shortcuts help
In the dialog showing hotkeys, the '?' key explanation was Show help dialog. However, it does not open an help page, but the list of keyboard shortcuts. This sentence is more clear.
2025-11-07 20:44:24 +01:00
Greg
ce3accb000
Merge pull request #122 from tt-rss/ip-port-work
Preserve port numbers, disallow local and private URLs in specific situations
2025-11-07 11:33:34 -06:00
supahgreg
d692863760
Improve handling of 'src' and 'srcset' in Sanitizer. 2025-11-07 17:29:37 +00:00
supahgreg
bbea44f5a4
Minor cleanup in Sanitizer. 2025-11-07 17:02:45 +00:00
supahgreg
0b1a8ec93e
Simplify some Sanitizer/UrlHelper stuff. 2025-11-07 16:02:15 +00:00
supahgreg
a041e2a390
Fix Sanitizer and test issues. 2025-11-07 10:01:07 +00:00
supahgreg
287e293a3a
Disallow localhost/loopback and private URLs in certain sanitization situations. 2025-11-07 08:15:46 +00:00
supahgreg
d92c1a9d84
Fix 'UrlHelper' stripping port numbers.
'UrlHelper::build_url()' and 'UrlHelper::rewrite_relative()' now preserve port numbers.
2025-11-07 03:34:27 +00:00
LaurentGH
c1235f1d97
Seven sentences were missing the gettext call to be translated 2025-11-06 23:21:13 +01:00
LaurentGH
6ad201357f
When a filter rule is not inversed display it in green
When a filter is edited, the Match tab contains one line per rule.

Rules which are not inverted should appear in green color. However, every rule line appears in red.

This is due to $rrow['inverse'] not being unset before calling _get_rule_name().

Indeed, function _get_rule_name() expects $rrow['inverse'] to be unset to mean "false", in order to have a behavior similar to the HTML checkbox which is unset when not checked on the web page.
2025-11-06 20:39:05 +01:00
supahgreg
25c58b006f
Make filter types and action names translatable.
Also fix rule name display when editing a filter.
2025-11-05 19:15:30 +00:00
LaurentGH
9cd7164e5c
Update PHP website url in the help message for date format 2025-11-04 18:19:28 +01:00
supahgreg
3dfee236d5
Fix an intended translation, update 'messages.pot'. 2025-11-04 16:55:32 +00:00