Commit Graph

124 Commits

Author SHA1 Message Date
maTh e679d3df0e
Improved: show Terms of Service in config menu (#5215)
* Use constants for path to TOS

* improve comments

* TOS title moved to template

* TOS available via config menu

* CSS: improve handling of content of TOS/about

* give info about set/unset TOS in system config

* fix target

* i18n FR

* i18n DE
2023-03-21 18:47:07 +01:00
Alexandre Alapetite 9b5de54a9c
Remove -x on some files not needing it (#5065) 2023-02-03 14:34:47 +01:00
berumuron daaa391e33
tec: Update the lib_opml (#4403)
* fix: Fix undefined GLOB_BRACE on Alpine

The manual states that:

> Note: The GLOB_BRACE flag is not available on some non GNU systems,
> like Solaris or Alpine Linux.

This generated an error on Alpine.

Reference: https://www.php.net/manual/function.glob.php

* fix: List details of feeds for OPML exportation

The details are necessary to export the XPath information, the CSS full
content path and read actions filters.

* Update LibOpml to 0.4.0

* Refactor OPML importation to be more robust

First, it fixes two regressions introduced by the update of lib_opml:

- title attribute is used when text attribute is missing;
- the OPML category attribute is used as a fallback for feeds categories.

In a related way, if also fixes a problem when a feed had both a parent
category outline and a category attribute. Before, it only considered the
attribute as its category, but now it considers the parent outline.

Then, it counts category limit correctly by not increasing
`$nb_categories` if the category already exists.

* Exclude lib_opml from the CodeSniffer

* Fix variable names when logging some errors

* Fix catch of LibOpml Exception

* Make sure to declare the category

* Exclude lib_opml from PHPStan analyze

* Disable markdownlint for lib_opml

* Fix typos

* Use auto-loading and allow updates via Composer

* Fix broken links to lib_opml

* Bring back the ability to import the OPML frss:opmlUrl attribute

* Refactor the logs of OPML errors

* Update lib_opml to the version 0.5.0

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-01-18 10:12:21 +01:00
Alexandre Alapetite 09aeeeb325
Refactor updateContext into its own FreshRSS_Context class (#4496)
So that it is both cleaner and easier to call from other controllers and extensions
2022-08-10 09:37:11 +02:00
maTh a534fc79c4
Fix: logs page=0 error (#4460)
* add docs of function param()

* page < 0 is impossible now

* show prev/next only, when there is a prev/next page

* set always page params

* Revert "page < 0 is impossible now"

This reverts commit fdb920ee50.

* Update logs_pagination.phtml
2022-07-27 18:52:30 +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
maTh 7d00ad8ed7
Improve: manage feed in view within a slider (#4226)
* it works

* small improvements

* Update slider.js

* fixed JS syntax

* slider.js included in main.js

* fix syntax

* delete including of slider.js

* Update extra.js
2022-03-22 23:09:50 +01: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
maTh dfee46792f
Improved: "Pagination" + load more button (#4125)
* Frontend changes done

* Load more should work now also without JS

* Update template.rtl.css

* improved the themes' CSS

* Update template.rtl.css

* fix CI

* CSS prop. order fixed

* Rename pagination.phtml to stream-footer.phtml

* use the new template name

* rename key of i18n

* fixed CI, that does not like the white space

* rename pagination variable

* Update indexController.php
2022-02-06 17:29:56 +01:00
Alexandre Alapetite 8808fb4545
Fix keep state after favourites tags (#4178)
* Fix keep state after favourites tags
#fix https://github.com/FreshRSS/FreshRSS/issues/4124 regression

* Optimisation
2022-01-29 14:19:16 +01:00
Thomas Renes 916df412f5
Fix various typos and spelling errors in documentation, comments and code. (#4134) 2022-01-08 16:25:17 +01:00
Alexandre Alapetite 1335a0e3cf
PHPStan level 5 (#4110)
* Fix most PHPDocs errors
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103
https://phpstan.org/writing-php-code/phpdoc-types

* Avoid func_get_args
Use variadic syntax instead https://php.net/manual/functions.arguments#functions.variable-arg-list
And avoid dynamic functions names when possible to more easily identify calls and unused functions.
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4103

* PHPStan level 3

* PHPStand level 4

* Update default to PHPStan level 4

* Towards level 5

* Fix level 4 regression

* Towards level 5

* Pass PHPStan level 5

* Towards level 6

* Remove erronenous regression from changelog
https://github.com/FreshRSS/FreshRSS/pull/4116
2022-01-04 13:59:09 +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
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 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
Marien Fressinaud 7802fd33a6 tec: Allow to change CSP header from controllers
For an extension, I needed to call a script from an external domain.
Unfortunately, the CSP headers didn't allow this domain and I had to
patch manually the FreshRSS FrontController for my extension. It's
obviously not a long-term solution since it has nothing to do in the
core of FRSS, and I don't want to apply this patch manually at each
update.

With this patch, I allow changing the CSP header from inside the
controller actions. It allows extensions to modify headers. It's also an
opportunity to remove a bit of code from the FrontController. I wasn't
happy with the previous implementation anyhow.

Reference: https://github.com/flusio/xExtension-Flus/commit/ed12d56#diff-ff12e33ed31b23bda327499fa6e84eccR143
2019-12-22 15:01:02 +01:00
Alexis Degrugillier f6e10579f2 Add category order (#2592)
* Add category order

Each category has a new 'priority' attribute. It is used to sort categories in
views. Categories with the same priority are sorted alphabetically. Categories
with no priority are displayed after those with one.

For example, if we have the following categories:
- A (priority: 2)
- B (no priority)
- C (priority: 1)
- D (priority: 2)
- E (no priority)
- F (priority: 1)

They will be displayed in the following order:
- C
- F
- A
- D
- B
- E

See #190

* Shorten help text

It took too much room and will not be so necessary once we have drag &
drop
2019-10-26 13:16:15 +02:00
Marien Fressinaud a2ed6626c2 Add support for terms of service
This feature is optional. It is based on the presence of a
`data/tos.html` file that an administrator can create. If this file
exists, FreshRSS will automatically add a "ToS" checkbox on the
registration page that users must check to be able to create their
account.
2019-09-17 09:21:23 +02:00
Marien Fressinaud 49e1a2c579 Allow to change the view layout (#2467)
The `_useLayout` function is marked as deprecated, replaced by a more
powerful `_layout` function.
2019-08-02 11:40:57 +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
Alexandre Alapetite 2374374ba9
Less jQuery (#2234)
* Less jQuery

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

* Even less jQuery + global view unread title fix

* Even less jQuery

* Yet even less jQuery

* Even less jQuery

* Reduce some events

* Even less jQuery

* jQuery gone from main view

+Fixed English i18n

* Fix feed folded view

* Remove Firefox 64 workaround

Remove workaround for Gecko bug 1514498 in Firefox 64, fixed in Firefox
65

* Split to extra.js

Avoid loading unneeded JavaScript code for the main view.
+ several adjustements

* Improve CSS transition fold category

* Rewrite shortcuts

Remove library. Much faster, shorter, one listener instead of many.
Control of the shortcut context.
Fix https://github.com/FreshRSS/FreshRSS/issues/2215

* Remove debug

* Minor syntax

* Filter out unwanted shortcut modifiers

* Menu overflow fix

* Typo

* Fix unfolding in mobile view

* Remove jQuery from category.js

* Remove jQuery from Global view
2019-02-13 15:06:28 +01: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 8ee8a573f1
Custom labels (#2027)
* First draft of custom tags

https://github.com/FreshRSS/FreshRSS/issues/928
https://github.com/FreshRSS/FreshRSS/issues/1367

* SMALLINT to BIGINT for id_entry

And uppercase SQL types

* Fix layout for unreads

* Start UI menu

* Change menu order

* Clean database helpers

https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r217971535

* Travis rules do not understand PostgreSQL constants

Grrr

* Tag controller + UI

* Add column attributes to tags

* Use only favicon for now, for label

* Fix styling for different themes

* Constant for maximum InnoDB index length in Unicode

https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r219052200
(I would have personnally prefered keeping the readability of a real
value instead of a constant, in this case of many SQL fields)

* Use FreshRSS_Factory::createCategoryDao

* Add view of all articles containing any tag

* Fix search in tags

* Mark as read tags

* Partial auto-update unread tags

* More auto update tag unreads

* Add tag deletion

* Do not purge tagged articles

* Minor comment

* Fix SQLite and UI bug

* Google Reader API support for user tags

Add SQL check that tag names must be distinct from category names

* whitespace

* Add missing API for EasyRSS

* Compatibility SQLite

Problematic parentheses

* Add SQL DISTINCT for cases with multiple tags

* Fix for PostgreSQL

PostgreSQL needs some additional type hint to avoid "could not determine
data type of parameter $1"

http://www.postgresql-archive.org/Could-not-determine-data-type-of-parameter-1-tp2171092p2171094.html
2018-09-29 20:47:17 +02:00
Alexandre Alapetite 4e8932d4bb
Minz: fix absolute URL bug (#2006)
* Fix absolute URL bug

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

* Better base_url guess in install.php

* Revert changes in install.php
2018-09-09 00:51:02 +02:00
Alexandre Alapetite 84d891f8cf
Light Boolean search implementation (#1828)
* Light Boolean search implementation

"Hello intitle:World OR date:P1D example"
https://github.com/FreshRSS/FreshRSS/issues/879

* Doc Boolean search

* Doc typos
2018-03-14 17:20:41 +01:00
Alexis Degrugillier 00776f4547 PHP 7.2: Fix a warning when retrieving the list of entries (#1739)
When retrieving the list of entries when the context was 'all' or 'starred', there was the following warning:

> Warning: count(): Parameter must be an array or an object that implements Countable in /home/alexis/FreshRSS/app/Controllers/indexController.php on line 206

I fixed that by changing how the array is tested.
2017-12-19 09:35:37 +01:00
Frans de Jonge 4e174ed9dd [ci] Add Travis (#1619)
* [ci] Add Travis

* Exclude some libs

* Semi-auto whitespace fixes

* line length in SQLite

* Exclude tests from line length

* Feed.php line length

* Feed.php: get rid of unnecessary concat

* Feed.php: line length

* bootstrap.php: no newline at end of file

* Allow concatenating across multiple lines

* Add Travis badge

* do-install line length

* update-or-create-user line length

* cli/create-user line length

* tests/app/Models/SearchTest.php fix indentation

* tests/app/Models/UserQueryTest.php fix indentation

* tests/app/Models/CategoryTest.php fix indentation

* [fix] PHP 5.3 on precise

* cli/do-install no spaces

* cli/list-users line length

* cli/reconfigure line length

* empty catch statements

* api/index line length nonsense

* spaces before semicolon

* app/Models/EntryDAO bunch of indentation

* extra blank lines

* spaces before comma in function call

* testing tabwidth

* increase to 10

* comment out tabwidth line

* try older phpcs version 3.0.0RC4

* line length exception for app/install.php

* proper spaces

* stray spaces in i18n

* Minz/ModelPdo line length

* Minz whitespace

* greader line length

* greader elseif placement

* app/Models/Feed.php spacing in function argument

* ignore php 5.3

* app/Models/ConfigurationSetter.php stray whitespace

* EntryDAOSQLite line length

* I vote for higher max line length =P

* ignore SQL

* remove classname complaint

* line length/more legible SQL

* ignore line length nonsense

* greader line length

* feedController issues

* uppercase TRUE, FALSE, NULL

* revert

* importExportController lowercase null

* Share.php default value not necessary because ! is_array () a few lines down

* CategoryDAO constants should be UPPERCASE

* EntryDAO reduce line length

* contentious autofix

* Allow failures on all versions of PHP except 7.1 because reasons
2017-09-22 12:13:46 +02:00
Alexandre Alapetite 56f66f4b61 Remove superflous category request
A category request was systematically done, although it is not always
needed.
2016-10-15 14:58:40 +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 02d1d66235 PHP 5.3 more compatibility
https://github.com/FreshRSS/FreshRSS/pull/1209#issuecomment-239617504
https://github.com/FreshRSS/FreshRSS/issues/1208
2016-08-13 15:35:52 +02:00
Alexandre Alapetite af31f1b20f PHP 5.3 scope compatibility
https://github.com/FreshRSS/FreshRSS/issues/1208
2016-08-13 10:35:45 +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 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 27d2b88a19 Minz getBaseUrl correction and RSS template bug
https://github.com/FreshRSS/FreshRSS/issues/848
Corrections in Minz (HTTP_HOST was not sanitized, getURI() was never
used and not working anyway with absolute base_url)
$this->url was not defined in rss.phtml
2015-05-23 02:23:38 +02:00
Alexis Degrugillier 1156129593 Use the search object to get values in the search
It is now possible to combine multiple keywords to do a search. The separation of concern is better now since the search extraction is not done in the DAO anymore.
At the moment, a multiple keyword search is stored as this. It could be nice to have it rendered differently in the search page to make it more readable.
At the moment, there is a problem with search enclosed by ". Same search works well when enclosed by '.
2015-02-21 09:46:21 -05: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 d27efeec04 Fix Controllers to use the correct config system
See https://github.com/FreshRSS/FreshRSS/issues/730
2015-01-06 17:38:31 +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 57bffe83eb Fix i18n for index Controller
Fix strings for:

- about page
- rss and reader views
- fix title of global view
2014-12-11 00:25:02 +01:00
Marien Fressinaud d455837c6d Fix i18n for normal view 2014-12-11 00:00:15 +01:00
Marien Fressinaud 8a40a72657 Fix i18n for logs, pagination and javascript vars
Logs first to avoid annoying message when refreshing log page
2014-12-10 23:16:12 +01:00
Marien Fressinaud 83d95ca4b8 Fix titles for normal and global views
See https://github.com/marienfressinaud/FreshRSS/issues/634
2014-10-24 15:11:02 +02:00
Marien Fressinaud 0d6993fe08 Reader view comes back!
See https://github.com/marienfressinaud/FreshRSS/issues/634
2014-10-24 12:51:17 +02:00
Marien Fressinaud 1efbf6fb86 Add comments to Context object.
See https://github.com/marienfressinaud/FreshRSS/issues/634
2014-10-22 20:05:00 +02:00
Marien Fressinaud 1fe5ed5d21 nextGet and idMax are coming back.
See https://github.com/marienfressinaud/FreshRSS/issues/634
2014-10-22 19:19:15 +02:00
Marien Fressinaud 9551145200 Better view mode
- Seperate view mode from default state in conf
- Load read articles if no unread articles only if view is adaptive

See https://github.com/marienfressinaud/FreshRSS/issues/634
2014-10-22 18:21:36 +02: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 b446a510eb Finish to update context object
See See https://github.com/marienfressinaud/FreshRSS/issues/634
2014-10-22 13:35:30 +02:00
Marien Fressinaud fcae415753 Update title and get parameter correctly.
See https://github.com/marienfressinaud/FreshRSS/issues/634
2014-10-22 13:13:24 +02:00