Commit Graph

98 Commits

Author SHA1 Message Date
maTh
1e8ef4bb72 Improve notifications: notificationName (#7287)
* notificationID

* 3 first examples

* fix

* notificationID -> notificationName

* Update lib/Minz/Request.php

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

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2025-02-02 19:15:03 +01:00
maTh
f72f5e9523 Improve notification banner (#7268)
* a -> button

* i18n: Close

* a.close -> .close

* themes

* Apply suggestions from code review

Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>

* Update app/i18n/fr/gen.php

---------

Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2025-01-31 13:58:57 +01:00
Alexandre Alapetite
897e4a3f4a Search in all feeds (#7144)
* Search in all feeds
Search in PRIORITY_ARCHIVED with `&get=A`
fix https://github.com/FreshRSS/FreshRSS/discussions/7143

* Fix type

* Search in PRIORITY_ARCHIVED with `&get=Z`

* More

* Fixes

* One more fix

* Extra features in user queries

* Move i18n key

* Fix overview

* Enlarge query boxes

* Revert i18n spelling

* i18n: it

Thanks @UserRoot-Luca

Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com>

---------

Co-authored-by: UserRoot-Luca <55756898+UserRoot-Luca@users.noreply.github.com>
2024-12-27 12:03:59 +01:00
Alexandre Alapetite
5b28a35003 Pass PHPStan level 9 (#6544)
* More PHPStan

* More, passing

* 4 more files

* Update to PHPStan 1.11.4
Needed for fixed bug: Consider numeric-string types after string concat
https://github.com/phpstan/phpstan/releases/tag/1.11.4

* Pass PHPStan level 9
Start tracking booleansInConditions

* Fix mark as read

* Fix doctype

* ctype_digit
2024-06-09 20:32:12 +02:00
maTh
1c0b8a7dcd Fix: dir=rtl (#6221)
* Update layout.phtml

* Update simple.phtml

* Update contentSelectorPreview.phtml
2024-03-21 10:25:58 +01:00
Alexandre Alapetite
5aeab896e9 Fix OPML export regression and add token in RSS link (#6160)
* OPML regression due to *shared user queries* (the XPath attributes were not exported anymore) https://github.com/FreshRSS/FreshRSS/pull/6052
* Add master token to HTML Meta RSS link and OPML link https://github.com/FreshRSS/FreshRSS/discussions/6159#discussioncomment-8678399
2024-03-05 14:26:52 +01:00
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
c7a3281a73 Fix notifications (#5959)
The notification about wrong login was not working. Noticed while working on https://github.com/FreshRSS/FreshRSS/pull/5955
This was due to timing of when the notification is retrieved.
Simplified code to make the logic easier and more robust.
2023-12-22 11:03:32 +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
cd004cb978 move darkMode_auto from body to html root (#5397) 2023-05-14 19:24:12 +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
maTh
068d18b69b Add: <meta name="theme-color"> (#5105)
* implemented

* themes' metadata.json

* fix

* fix

* retrigger tests

* Update lib/Minz/View.php

Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com>

* Update lib/Minz/View.php

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

* Update lib/Minz/View.php

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

* Update lib/Minz/View.php

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

* fix

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com>
2023-03-04 15:05:58 +01:00
maTh
b5a418ec16 Added: Dark mode for Origine +Origine compact themes (#4843)
* first draft

* fix: theme slider: properties box

* improved colors

* option to enable/disable dark mode

* fixes

* Update app/i18n/fr/conf.php

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

* i18n english improved

* fix dark background color for favorites + hover colors

* select list: no, auto

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-01-09 10:40:38 +01:00
acbgbca
edbf0fe7db Added bottom nav padding for iOS #4740 (#4741)
* Added bottom nav padding for iOS #4740

* Updated RTL css #4740

Co-authored-by: maTh <math-home@web.de>
2022-10-24 13:19:26 +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
dcc77ee343 Initial support for PHP 8.2 (#4421)
* Initial support for PHP 8.2
Using dev image `freshrss/freshrss:latest` https://github.com/FreshRSS/FreshRSS/pull/4420

* Deprecated string interpolation
2022-06-19 20:10:13 +02:00
maTh
807ea755e0 fix preview (#4291)
* fix

* Update extra.js

* reorga the scripts

* Update extra.js

* Several fixes
https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1125472321

* More fixes

* Cleaning

* fix pr 4291

* Reorganise some script functions

* Remove unused popup-txt
And associated function openPopupWithMessage

* Fix archiving categories
https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126924602

* Fix stats
https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126983134

* Fix direct subscription
E.g. http://localhost/i/?c=subscription&id=735

* Fix subscription add
https://github.com/FreshRSS/FreshRSS/pull/4291#issuecomment-1126991621

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2022-05-15 21:52:52 +02:00
Alexandre Alapetite
0698c8a0b2 Do not render irrelevant HTML for Ajax calls (#4310)
#fix https://github.com/FreshRSS/FreshRSS/issues/4309
2022-04-11 22:55:29 +02:00
Alexandre Alapetite
1fe66ad020 Implement Web scraping "HTML + XPath" (#4220)
* More PHP type hints for Fever
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/4201
Related to https://github.com/FreshRSS/FreshRSS/issues/4200

* Detail

* Draft

* Progress

* More draft

* Fix thumbnail PHP type hint
https://github.com/FreshRSS/FreshRSS/issues/4215

* More types

* A bit more

* Refactor FreshRSS_Entry::fromArray

* Progress

* Starts to work

* Categories

* Fonctional

* Layout update

* Fix relative URLs

* Cache system

* Forgotten files

* Remove a debug line

* Automatic form validation of XPath expressions

* data-leave-validation

* Fix reload action

* Simpler examples

* Fix column type for PostgreSQL

* Enforce HTTP encoding

* Readme

* Fix get full content

* target="_blank"

* gitignore

* htmlspecialchars_utf8

* Implement HTML <base>
And fix/revert `xml:base` support in SimplePie e49c578817

* SimplePie upstream PR merged
https://github.com/simplepie/simplepie/pull/723
2022-02-28 20:22:43 +01:00
Alexandre Alapetite
77e9877316 Add PHPStan (#4021)
* Add PHPStan
#fix https://github.com/FreshRSS/FreshRSS/issues/4016
https://phpstan.org/

```sh
composer run-script phpstan
```

* More fixes

* Fix global variables

* Add .phtml

* Fix merge
https://github.com/FreshRSS/FreshRSS/pull/4090

* Fix more warnings

* Fix view errors and enable in CI

* ReturnTypeWillChange

* Dynamic view type

* Fix Minz static/self bug
2021-12-31 17:00:51 +01:00
maTh
a54aa19dc7 Fix: double main tags (#4014)
* replace div with main

* include the slider into main

* format source

* add close icon for the extension slider

* replace div with main

* Update shortcut.phtml

* fixed the nits
2021-12-03 00:57:32 +01:00
proletarius101
d3be01a1da Add pwa (#3890)
* Don't use Chrome or indeed Firefox on Android

Would close #1963. But I will not finish this PR because the idea that every single website on the internet should have to do this is absolutely ridiculous.

* add pwa manifest

Add a pwa manifest as defined in https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Installable_PWAs
- creates shortcuts without the browser frame
- has a splash screen
- has an independent view stack than the browser one

* update manifest as per pwabuilder.com

* add 32x32 and 48x48 icon config

* enhance manifest spec compliance

* change as per suggestions

* Update app/layout/layout.phtml

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

* fix mobile icon padding

* remove screen auto rotation

* change theme color to white

* Move meta
(Should not be in the referrer condition)

* JSON HTTP cache

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-10-24 17:28:40 +02:00
maTh
802409be90 main + nav (#3747) 2021-08-15 23:34:09 +02:00
Alexandre Alapetite
191cda42e6 Misc. minor
Whitespace...
2020-10-11 10:59:43 +02:00
Alexandre Alapetite
39df5a8041 Revert FOUC fix (#2991)
Revert https://github.com/FreshRSS/FreshRSS/pull/2913
I have not seen any difference with/without this fix, and it might be
due to the fact that is is blocked by CSP.
At least in Chrome, it generates CSP warnings.
If it should be re-introduced, see warning suggestions:

> Refused to execute inline script because it violates the following
Content Security Policy directive: "default-src 'self'". Either the
'unsafe-inline' keyword, a hash
('sha256-gcoEgwf1rABkUXPaVY2M1RH34tUHWGDn9nAAn/kGYUE='), or a nonce
('nonce-...') is required to enable inline execution. Note also that
'script-src' was not explicitly set, so 'default-src' is used as a
fallback.
2020-05-21 20:55:28 +02:00
Kristian Salonen
bd9a72726d Fix for "Flash Of Unstyled Content" and slow loading in the Firefox (#2913) 2020-04-20 23:20:34 +02:00
Frans de Jonge
25666ec5d3 [UI] Add RTL support with RTLCSS (#2776)
* Add dir info to gen.php & install.php!

* Add `make rtl` command

Using rtlcss because it has actually has a command-line application!
2020-03-01 21:15:17 +01:00
Julien-Pierre Avérous
d30ac40772 Enhance content path feature (#2778)
- Add a maintenance section to be able to clear cache and force reload a feed.
- Add an icon next to path field to show a pop-up with the result of the content path.

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Marien Fressinaud <dev@marienfressinaud.fr>
2020-02-13 18:22:35 +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
5b030dcc6f Ensure fast flush of HTTP headers and HTML head (#2045)
* Ensure fast flush of HTTP headers and HTML head

The fast flush optimisation done in
https://github.com/FreshRSS/FreshRSS/pull/1133 does not seem to work
anymore (need to check if it is related to a PHP version).
Work-around when PHP flush() is not working
Can be tested by adding a `sleep(5);` after:

ee902ee7c4/app/layout/layout.phtml (L27)
Follow-up of the performance checks of
https://github.com/FreshRSS/FreshRSS/pull/2040

* output_buffering in .user.ini for PHP CGI / FPM

* Reuse .user.ini for Docker PHP config

* Longer flush

Flush a bit later, to be compatible with the default value of 4096 for
PHP output_buffering, and thus avoid the need of tuning the value.
2018-10-14 14:37:50 +02:00
Alexandre Alapetite
1cc891be35 Remove some preload / prefetch (#2040)
* Remove next prefetch

This approach was only efficient in the specific case when no change was
made (no mark-as-read, favourites, tags), and useless in the other
situations.
Removed to reduce server load.

* Remove next prefetch from JavaScript too

* Remove some preload / prefetch

While useful for the first request, those preload / prefetch hints are
slightly negative for the following requets, especially server-side,
e.g. generating one log entry in Apache, and a bit more network traffic.

* Revert mistake

* Remove comment

https://github.com/FreshRSS/FreshRSS/pull/2040#discussion_r223214915
2018-10-14 00:35:43 +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
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
a6071a0d98 PHP 5.3 compatibility for callback
https://github.com/FreshRSS/FreshRSS/issues/1208
2016-08-12 22:56:02 +02:00
Alexandre Alapetite
dccc2a8435 meta referrer origin
https://github.com/FreshRSS/FreshRSS/issues/955
Tested in Firefox 48, Chrome 53, Edge 25
2016-08-07 13:52:57 +02:00
Alexandre Alapetite
b042d3a772 HTTP2 optimization
Fast flush HTTP headers, push promise CSS.
Requires PHP 5.3+ due to anonymous function.
Do not load syles, scripts, and notifications for Ajax requests.
https://github.com/FreshRSS/FreshRSS/issues/1089
2016-04-23 19:10:32 +02:00
Alexandre Alapetite
e3dc7d46e1 CSP: Use inline JSON instead of one-time cookie
Simpler, lighter
https://github.com/FreshRSS/FreshRSS/issues/1075
2016-02-21 14:23:24 +01:00
Alexandre Alapetite
e4a459a6ed CSP no inline javascript draft
https://github.com/FreshRSS/FreshRSS/issues/1075
2016-02-16 23:53:39 +01:00
Alexandre Alapetite
362dbad0b8 Several position problems, in particular in the global view
Multiple small bugs in global and reader views.
Related to these old issues:
https://github.com/FreshRSS/FreshRSS/issues/634
https://github.com/FreshRSS/FreshRSS/issues/275
2016-01-24 13:18:48 +01:00
Alexandre Alapetite
0a1b628265 ENT_COMPAT
https://github.com/FreshRSS/FreshRSS/pull
https://github.com/FreshRSS/FreshRSS/issues/938
2015-10-27 22:11:19 +01:00
Alexandre Alapetite
02a3cb4652 Config allow robots
https://github.com/FreshRSS/FreshRSS/issues/938
2015-10-25 00:01:13 +02: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
d3a93ea290 BREAKING FEATURE: Remove general in config
General attribute has been removed from system config.
Now subattributes (e.g. environment, salt, title, etc.) are directly accessible.

YOU HAVE TO FIX YOUR ./data/config.php file!

- Remove the general array
- Values inside this array must be kept
- To see what it must look like, please have a look to ./data/config.default.php
  (but keep your values!!).

See https://github.com/FreshRSS/FreshRSS/issues/730
2015-01-06 18:53:36 +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
Marien Fressinaud
51a71ec4b9 New configuration system (not working yet)
- Use only Minz_Configuration
- register() method to load a new configuration file
- get() to get a configuration
- new exceptions related to configuration
- fix a list configuration calls to have FRSS working

Current problems to resolve:

- How to handle configuration param verifications (i.e. check auth_type
  is a value from none, http_auth, persona or form)
- We must use $conf = Minz_Configuration::get('system'); $general_conf = $conf->general;
  to access global system configuration which is quite annoying. How to change that?

See https://github.com/FreshRSS/FreshRSS/issues/730
2015-01-05 16:54:16 +01:00
Marien Fressinaud
98587d5d61 Fix a set of TODO and bugs
- Context object raises correct Exception if get is invalid
- RSS feed is well-indicated on the home page
- State is better calculated
- Add some comments

See https://github.com/marienfressinaud/FreshRSS/issues/634
2014-10-22 17:57:22 +02:00
Marien Fressinaud
f1f9b2f5ff Entries are loaded again! It's working :)
See https://github.com/marienfressinaud/FreshRSS/issues/634
2014-10-22 13:52:20 +02:00
Marien Fressinaud
1a22a87fb1 Use FreshRSS_Context::$conf only
- Replace $this->view->conf in controllers
- Replace $this->conf in views
2014-10-20 18:45:22 +02:00