Commit Graph

138 Commits

Author SHA1 Message Date
Alexandre Alapetite 39cc1c11ec
New feature: shareable user query (#6052)
* New feature: shareable user query
Share the output of a user query by RSS / HTML / OPML with other people through unique URLs.
Replaces the global admin token, which was the only option (but unsafe) to share RSS outputs with other people.
Also add a new HTML output for people without an RSS reader.

fix https://github.com/FreshRSS/FreshRSS/issues/3066#issuecomment-648977890
fix https://github.com/FreshRSS/FreshRSS/issues/3178#issuecomment-769435504

* Remove unused method

* Fix token saving

* Implement HTML view

* Update i18n for master token

* Revert i18n get_favorite

* Fix missing i18n for user queries from before this PR

* Remove irrelevant tests

* Add link to RSS version

* Fix getGet

* Fix getState

* Fix getSearch

* Alternative getSearch

* Default getOrder

* Explicit default state

* Fix test

* Add OPML sharing

* Remove many redundant SQL queries from original implementation of user queries

* Fix article tags

* Use default user settings

* Prepare public search

* Fixes

* Allow user search on article tags

* Implement user search

* Revert filter bug

* Revert wrong SQL left outer join change

* Implement checkboxes

* Safe check of OPML

* Fix label

* Remove RSS button to favour new sharing method
That sharing button was using a global admin token

* First version of HTTP 304

* Disallow some recusrivity
fix https://github.com/FreshRSS/FreshRSS/issues/6086

* Draft of nav

* Minor httpConditional

* Add support for offset for pagination

* Fix offset pagination

* Fix explicit order ASC

* Add documentation

* Help links i18n

* Note about deprecated master token

* Typo

* Doc about format
2024-02-26 09:01:03 +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
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
maTh e1ad4fc733
Navigation buttons: Group icons (.group instead of .stick) (#5737)
* replace stick with group + update the themes

* Update nav_menu.phtml

---------

Co-authored-by: math-gh <>
2023-10-24 23:43:50 +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 4de1d5efea
Fix mark-selection-as-unread (#5367)
The "mark selection as unread" button would mark articles as read instead of unread...
2023-05-02 14:37:19 +02:00
Alexandre Alapetite 2208974c00
PHPStan Level 7 for FreshRSS_UserQuery (#5319)
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/5318
2023-04-20 09:14:58 +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
Luc SANCHEZ 5f898dcc5e
Modernize Constants and use new constant for string 'currentUser' (#5089)
* Modernize Constants and use new constant 'currentUser'

* Add FreshRSS_Context::currentUser() function and use

* Add FreshRSS_Context::currentUser() function and use

* Add FreshRSS_Context::currentUser() function and use

* Add FreshRSS_Context::currentUser() function and use

* Add FreshRSS_Context::currentUser() function and use

* Update app/Controllers/userController.php

* Update app/Controllers/userController.php

* Update app/Controllers/userController.php

* Update app/Models/Auth.php

* Update p/api/greader.php

* Update p/api/greader.php

* Update p/api/greader.php

* Update app/Models/Context.php

* Update app/Models/LogDAO.php

* Update lib/Minz/Log.php

* Update p/api/greader.php

* Update app/layout/header.phtml

* Update app/views/helpers/export/articles.phtml

* Update cli/do-install.php

* Remarque's from Alkarex

* Remarque's from Alkarex

* Refactor using new Minz_User class

* Consistent naming of public constants

---------

Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-03-26 14:17:22 +02:00
maTh e53ba88bb9
Search Improved: dropdown (#4994)
* first draft

* fix

* RTL CSS

* add link to documentation

* hide search button in desktop view

* rename .no-desktop to .only-mobile

* i18n

* add ID

* Theme: Swage

* Theme Scewdriver

* Theme Pafat

* Theme flat

* Theme: Adark

* Theme: Dark

* i18n: German

* i18n en-us

* fix i18n

* Update app/i18n/fr/gen.php

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

* Update app/layout/nav_menu.phtml

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

* Update app/layout/nav_menu.phtml

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

* Update app/layout/nav_menu.phtml

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

* wip

* mapco theme

* RTL for Ansum and Mapco

* fix

* fix

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-01-30 20:32:55 +01:00
maTh 92d1b0cda7
Keep view for search landing page (#4981) 2023-01-02 21:54:00 +01:00
maTh 645224a303
Improved: Remove <li> as separator (#4597)
* templates

* themes

* fix

* fix

* fixes

* fix
2022-10-03 21:50:40 +02:00
Alexandre Alapetite f85c510ed4
New search engine (#4378)
* New possibility to invoke user queries from a search expression
From the search field: `S:"My query"`.
Can be combined with other filters such as `S:"My query" date:P3d` as long as the user queries do not contain `OR`.
A use-case is to have an RSS filter with a stable address or an external API call with the ability to update the user query.

* Draft of parenthesis logic

* More draft

* Working parenthesis (a OR b) (c OR d)

* Working (A) OR (B)

* Support nested parentheses + unit tests + documentation

* search:MySearch and S:3
2022-06-02 08:41:08 +02:00
Alexandre Alapetite 20eba951f7
Fix bug in user query 4360 (#4371)
Fix bug when taking advantage of https://github.com/FreshRSS/FreshRSS/pull/4360
At one place, the raw URL parameter was accessed instead of being reconstructed
2022-05-17 22:46:08 +02:00
maTh 4191f9859e
Improved: dropdown close area (#4293)
* fix Ansum theme: close X in white

* fix Mapco theme: close X in white

* move the dropdown-close outside of the list

* CSS

* bring flux elemt behind the grey background

* Update main.js
2022-04-11 22:54:19 +02:00
maTh d2b6fe099a
Improvement: menu icons (#4004)
* default icons

* icons Flat theme

* icons Swage theme

* icon gets bright when hover: Ansum theme

* icon gets bright when hover: Blue lagoon theme

* icon gets bright when hover: Origine/Origine Compact theme

* compressed SVG

* Better formated SVG/XML files

* Update bookmark-tag.svg
2022-01-12 23:04:59 +01:00
maTh f8c5df28ab
delete the no-mobile css class (#4128) 2022-01-07 00:35:58 +01:00
maTh ab0285b0aa
Add HTML5 tags (#3651)
* use HTML5 tags #3643

added some HTML5 tags: header, main, nav

* <main> into <div>

as dicussed in the PR.
Todo: check side effects (f.e. threepaneview extension)

* fixed whitespace with tabs

* fixed more whitespaces with tabs

it was not my fault, but I fixed it

* added empty lines as wished

* Update app/views/index/global.phtml

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

* Update app/views/index/global.phtml

* Update app/views/index/global.phtml

* Update app/views/index/global.phtml

* Update app/views/index/global.phtml

* Update app/views/index/global.phtml

* Update app/views/index/global.phtml

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2021-07-21 22:42:04 +02:00
Alexandre Alapetite 947e918f05
Travis: Enforce phpcs line length + whitespace (#3488)
* Update Travis line length

* Also check whitespace in CSS files

* Fix line length ext.php

* More syntax, string templates

* Fix exclude-pattern

* Test JS files as well
2021-02-28 12:26:24 +01:00
Clemens Neubauer b1285466f2
fix layout changes since new hook `nav_menu` (#3362)
* fix layout if no hooks `nav_menu` are active

* Update app/layout/nav_menu.phtml

oh thx

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

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-01-12 20:30:32 +01:00
Alexis Degrugillier 85cbfcedb5
Update user query feature (#3338)
* Change user query wording

There was some misunderstanding in the use of the user query feature,
probably because of the wording. I've change it to make it more obvious.

* Fix feedback when a query is bookmarked

Before, the displayed query name was not the one intended. Now, the name is the one of the current bookmark

* Document user queries

I've added a few words on how to use the user queries because it seems there was some misunderstanding. See #3219
2021-01-07 21:47:39 +01:00
Clemens Neubauer ef458992c1
two new hooks (#3342)
* add two new hooks

I develop a new extension and i need 2 new hooks for it

* update EN documentation

* Correct typing errors

* Update app/views/helpers/javascript_vars.phtml

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-01-07 21:45:48 +01:00
Alexandre Alapetite 0442243037
Fix nav_menu mark-as-read (#2909)
* Fix nav_menu mark-as-read

#Fix https://github.com/FreshRSS/FreshRSS/issues/2905
Fix regression from https://github.com/FreshRSS/FreshRSS/pull/2588

We need info about the first item (id_max) before being able to output
nav_menu. Before https://github.com/FreshRSS/FreshRSS/pull/2588 we used
to output everything in memory before starting to produce an output. Now
that we stream the output, we need a temporary buffer until we have
received the first item/article.

* Repair loading page

* Simplify CSS

Make it work in Chrome as well

* Lint

* Partial revert

* Base max_id solely on current time
2020-05-18 18:45:47 +02:00
Alexandre Alapetite 22916d6a3e
Loader animation while waiting for first articles (#2845)
* Loader animation while waiting for first articles

Especially useful when a slow search is being performed.
Thanks to one new flush at the right time, the left colum and top menu
will be there, waiting for the articles to come. This avoids layout
flashes (the left column used to take the full width while waiting for
articles).
For optimal use, this assumes that the deployment has a proper buffering
configuration, such as in our official Docker image (also when using
Træfik as a reverse proxy in front). Might not work just as well with
other Apache or nginx setups.

* Fix on mobile

And simplified CSS

* Properly hide the loader

It was not possible to find a position where the loading animation would
be always hidden after load, so change strategy to hide it automatically
by CSS when the actual content has arrived
2020-03-28 12:33:57 +01:00
Alexandre Alapetite 0f94402b7e
Better performance with yield (#2588)
* Better performance with yield

Largely decrease the time to first byte, and reduced memory consumtion.
Before, we used to make several copies in memory of the whole list of
articles before sending them to the client. Now streamed as they are
processed.

* Travis
2020-02-29 18:19:09 +01:00
Alexandre Alapetite 7a5236de3f
Take advantage of PHP 5.4+ short echo (#2585)
* Take advantage of PHP 5.4+ short echo

https://php.net/migration54.new-features thanks to
https://github.com/FreshRSS/FreshRSS/pull/2495

Use `<?=  ?>` instead of `<?php echo; ?>`
10kB of code saved :-)

Done with regular expression:
```
<\?php echo (.+?);? *\?>
<?= \1 ?>
```

* Try Travis fix

https://github.com/squizlabs/PHP_CodeSniffer/issues/2045#issuecomment-395238272
2019-10-23 11:18:20 +02:00
Alexandre Alapetite ad19b6bf2e
Fix wrong mark-as-read maxId argument (#2431)
Fix https://github.com/FreshRSS/FreshRSS/issues/2429
2019-06-29 20:47:38 +02:00
Patrick Crandol 983aa587ee Add aside_feed to reader view (#2180)
* Add Nav menu to reader mode

At this point, it appears to be non-functional in reader mode.

* Add aside_feed toggle to reader view

* make init_column_categories work in reader view

* Make sidebar links redirect to proper view

* CSS to support toggleable sidebar in reader view

* remove unneeded !important
2018-12-15 10:56:38 +01:00
Alexandre Alapetite d3f5bd840d
Add mark-as-unread (#1995)
* Add mark-as-unread

https://github.com/FreshRSS/FreshRSS/issues/1966

* Change sentence

https://github.com/FreshRSS/FreshRSS/pull/1995#discussion_r214515954

* Enable mark-as-unread only when unread articles are shown

In order to prevent erroneous marking-as-unread.
We might find a better logic later.

* Disable instead of hide mark-as-unread option

To make it easier to discover
2018-09-03 20:48:04 +02:00
Alexandre Alapetite a66b995be7
Explicit quotes decoding (#1947)
* Explicit quotes decoding

* Explicit htmlspecialchars_decode and htmlspecialchars
2018-06-22 16:07:48 +02:00
Alexandre Alapetite c4903bc8db
Fix double encoding for mark as read a search (#1945)
* Fix double encoding for mark as read a search

Fix https://github.com/FreshRSS/FreshRSS/issues/1944

* Fix more search encoding issues
2018-06-20 20:49:48 +02:00
Alexis Degrugillier 951eb708e6 Fix shortcuts for view switching
I've introduced shortcuts to switch between view in #1755. They have been broken by #1714.
Then I've made an ugly fix in #1758.

This change revert all changes to have something better.

See #1757
2018-01-26 08:17:32 +01:00
Kevin Papst 047fa17aeb fixed css classes for reading mode buttons #1714 2018-01-24 19:37:24 +01:00
Alexandre Alapetite a756878219
Merge pull request #1714 from kevinpapst/hook-readingmodes
Added extension hook for reading modes
2018-01-01 20:49:18 +01:00
Alexandre Alapetite 97d4250bd3 Minor syntax 2018-01-01 20:48:33 +01:00
Kevin Papst 1b7cc49d22 refactored ReadingModes to Model 2017-12-10 15:04:01 +01:00
Kevin Papst 84c78098d2 added new extension hook
using hook for reading modes in navigation
2017-12-10 11:31:19 +01:00
Alexis Degrugillier ac60e35f6a Improve translation tools
I was not happy with the previous version. I refactored everything to make it reusable.
It allows me do do more verifications and to build a tool to handle the files themselves.
2017-10-10 06:46:25 +02:00
Alexandre Alapetite 0ce43be9de Multi-user token
https://github.com/FreshRSS/FreshRSS/issues/1390
https://github.com/FreshRSS/FreshRSS/issues/366
2017-04-09 00:25:04 +02:00
Alexandre Alapetite 00f446d155 Disable "mark all as read" before confirmation script is loaded
https://github.com/FreshRSS/FreshRSS/issues/1342
2016-10-29 13:11:37 +02:00
Alexandre Alapetite 2a5aa34ad2 Better control of number of entries per page or RSS feed
https://github.com/FreshRSS/FreshRSS/issues/1249
* Since X hours: `https://freshrss.example/i/?a=rss&hours=3`
* Explicit number: `https://freshrss.example/i/?a=rss&nb=10`
* Limited by `min_posts_per_rss` and `max_posts_per_rss` in user config
2016-09-11 15:06:33 +02:00
Alexandre Alapetite 8a776f1461 Prevent a target _blank attacks with window.opener
https://mathiasbynens.github.io/rel-noopener/
noopener is implied by noreferrer
https://html.spec.whatwg.org/multipage/semantics.html#link-type-noreferrer
The API for window.open() does not seem stable yet
https://bugzilla.mozilla.org/show_bug.cgi?id=1267339
2016-09-07 14:35:51 +02:00
Alexandre Alapetite 32c734ef62 SQL mark search as read
https://github.com/FreshRSS/FreshRSS/issues/608
2016-08-18 00:00:08 +02:00
Alexandre Alapetite a0230ad70b Minor HTML fixes
Fix aria bug. Move some content before the flush. XHTML syntax.
2016-08-15 21:57:37 +02:00
Alexandre Alapetite e6fd34bdda CSRF token, update HTTP Referrer policy to same-origin
https://www.w3.org/TR/referrer-policy/#referrer-policy-no-referrer
https://github.com/FreshRSS/FreshRSS/issues/570
https://github.com/FreshRSS/FreshRSS/issues/955
https://github.com/FreshRSS/FreshRSS/issues/1198
https://github.com/FreshRSS/FreshRSS/issues/565
https://github.com/FreshRSS/FreshRSS/issues/554
2016-08-13 17:49:31 +02:00
Alexandre Alapetite 93f7f84987 Restaure compatibility with Internet Explorer 11 / Edge
https://github.com/FreshRSS/FreshRSS/issues/772
2016-07-31 18:25:02 +02:00
Alexandre Alapetite cb913a3a76 CSP for statistics and forms
https://github.com/FreshRSS/FreshRSS/issues/1075
2016-02-21 19:15:23 +01:00
Alexandre Alapetite 211569ef85 Minz: missing URL key/param encoding
Caused searches such as "intitle:&amp;" to fail after paging, and
possible XSS vulnerabilities.
Discovered during https://github.com/FreshRSS/FreshRSS/issues/754
2015-01-21 00:44:26 +01:00
Marien Fressinaud 5f9672111f Fix last calls to Minz_Configuration methods
- We have still to fix actualize_script and greader api (refactoring?)
- We have to fix the FreshRSS_Configuration calls
- We have to fix availableLanguages calls

See https://github.com/FreshRSS/FreshRSS/issues/730
2015-01-06 20:50:58 +01:00
Marien Fressinaud 7cca47d1ab Change name of user configuration var in Context
- FreshRSS_Context::$conf is replaced by FreshRSS_Context::$user_conf
- Introduce FreshRSS_Context::$system_conf
- Remove FreshRSS_Configuration object

See https://github.com/FreshRSS/FreshRSS/issues/730
2015-01-05 22:45:03 +01:00