Commit Graph

566 Commits

Author SHA1 Message Date
Alexandre Alapetite
8d8b792007 Fix array_chunk key index bug (#3631)
* Fix array_chunk key index bug
#fix https://github.com/FreshRSS/FreshRSS/issues/3630
We still want array entries indexed sequentially from zero https://php.net/function.array-chunk

* One missing
2021-05-18 22:50:51 +02:00
Alexandre Alapetite
607f7e7254 Fix several comments syntaxes (#3615)
Mainly wrong `@return` types in comments
2021-05-08 10:27:18 +02:00
Alexandre Alapetite
f2557bed9a More cases of max SQL variable number (#3586)
Follow up of https://github.com/FreshRSS/FreshRSS/pull/3553
2021-05-08 00:56:06 +02:00
Alexandre Alapetite
87d1036647 Fix regression media attachments (#3565)
#fix https://github.com/FreshRSS/FreshRSS/issues/3564
Bug introduced by https://github.com/FreshRSS/FreshRSS/pull/3361
2021-03-27 22:16:44 +01:00
Alexandre Alapetite
eeff1a17b0 Suport standard HTTP 410 Gone (#3561)
When a feed returns an HTTP 410 Gone, mute the corresponding feed, i.e. stop refreshing it.
Example of such feed, Les Décodeurs (Libération) https://rss.liberation.fr/rss/100893/
2021-03-26 19:13:23 +01:00
Alexandre Alapetite
de40f3ad56 Fix TT-RSS import (#3553) 2021-03-24 19:04:51 +01:00
Alexandre Alapetite
90a0028d49 Fix DB lock bug during refresh (MariaDB) (#3559)
#fix https://github.com/FreshRSS/FreshRSS/issues/3552
2021-03-23 22:31:48 +01:00
Alexandre Alapetite
b88e44a594 Check pdo_sqlite for export/import SQLite (#3545) 2021-03-23 16:29:58 +01:00
Alexandre Alapetite
b7fdfbb894 SimplePie prevent cache pollution (#3502)
* SimplePie prevent cache polution
#fix https://github.com/FreshRSS/FreshRSS/pull/3367#issuecomment-766250249
#fix https://github.com/FreshRSS/FreshRSS/pull/3494#issuecomment-790113663

* Fix bug

* Minor improvement

* Update cache filename in FreshRSS (1/2)

* cacheFilename temp

* New SimplePie get_cache_filename()

* Fix typos

* Update lib/SimplePie/SimplePie.php

Typo

* Include user-agent and timeout

* fix array_merge

* Declaration

* force_feed was lost in a commit
2021-03-09 08:41:47 +01:00
Alexandre Alapetite
ef4a826e34 Reload full content when changed (#3506)
* Reload full content when changed
If an article is changed, reload also its full content when applicable.

* Compute hash before getting full content

* Revert mix two PRs

* Update app/Controllers/feedController.php
2021-03-09 08:41:01 +01:00
Alexandre Alapetite
0206fc1e5e fix updateEntryPrepared (#3500) 2021-03-07 19:41:17 +01:00
Alexandre Alapetite
b10cd770ee SQLite: fix updateEntry (#3461)
* Draft of fix for updateEntry

#fix https://github.com/FreshRSS/FreshRSS/issues/3130

* Fix for SQLite

* Update app/Models/EntryDAO.php

Fixed in https://github.com/FreshRSS/FreshRSS/pull/3500

* Unbuffered streaming only for MySQL
2021-03-07 17:34:47 +01: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
Alexis Degrugillier
ea5cd595c9 Remove + conversion in search except for tags (#3489)
Before, every + sign was converted to a space to allow to search for
spaces. But the documentation stated that to search for space one has
to enclose the string in quotes. This has a confusing behavior when
searching for a string containing a + sign.
Now, the + conversion is kept only for the tag search since it's the
only one documented that way.

See #3454
2021-02-27 17:34:48 +01:00
Alexis Degrugillier
449fee7a2c "Show all" option on labels (#3472)
It uses the favorite option to keep a similar experience through out the application and also to limit the number of options.

See #3263
2021-02-26 23:31:01 +01:00
Alexis Degrugillier
4313c09e68 Fix feed sort order (#3466)
Before, the feeds in the list weren't properly ordered. Uppercase
values were before lowercase values.
Now, the feed order is forced to ignore the case.

See #3228
2021-02-20 00:33:33 +01:00
Alexis Degrugillier
9682fcfebb Add full content delimiter and action (#3463)
Before, when appending or prepending the content of the CSS selector
content, it was added to the content. It was working fine for the
first call but every subsequent calls were pilling the retrieved
content on top of the already retrieved content. Thus we had an ever
growing content with a lot of duplication.
Now, the CSS selector content is identified by an HTML comment which
is used to remove the content for every subsequent calls.

The bug was introduced in #3453
2021-02-20 00:30:18 +01:00
Alexis Degrugillier
fe1fba9828 Add a content action parameter to work with CSS selector (#3453)
Before, when retrieving article contents with CSS selector, the content
of the RSS feed was replaced by the content of the CSS selector. It works
well in most of the cases but if there is a different content in the feed
and in the selector, the former is lost.
Now, there is a parameter to decide which action is performed after retrieving
the content. By default, the previous behavior is kept. But now, it is
possible to append or prepend the CSS selector content to the feed content.

See #3451
2021-02-16 18:00:49 +01:00
Alexandre Alapetite
1ee1fcce91 INSERT ... ON CONFLIT DO NOTHING for addEntry (#3409)
#fix https://github.com/FreshRSS/FreshRSS/issues/3402
Explicit `INSERT OR IGNORE` / `ON CONFLICT DO NOTHING` for the
`addEntry()` method, which does expect some duplicates.
2021-02-02 00:03:59 +01:00
Eris
ee175dd616 CURLOPT parameters per feed (#3367)
* Working curlopt_params

* Examples

* curl_params for fetching the article

* cleanup

* clarification

* Remove debugging

* Options corrected

* Removed Debugging

* i18n not needed (right now)

* Translations and UI rework

* Checks in update.phtml

* Unset Proxy&Cookies

* remove clutter

* minor fuckup

* i18n added properly

* resolve Errors

* linting errors

* linting errors, again

* Review

* Minor revert

* Minor i18n: de

Co-authored-by: maru <maru@nyx.im>
Co-authored-by: Aeris <a3x@eris.cc>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-01-16 22:32:18 +01:00
Alexandre Alapetite
6d8b1ba834 Fix images in enclosures without MIME type (#3361)
#fix https://github.com/FreshRSS/FreshRSS/issues/3358
Assume enclosures without a mime type, without a length, but with either
a width or a height are images
2021-01-12 09:34:13 +01:00
Craig Andrews
f9687ea18a Fix commitNewEntries query (#3357)
There was an erroneous '; at the end of the commitNewEntries DELETE query, resulting in an exception during actualization with this output:

```
FreshRSS starting feeds actualization at 2021-01-11T14:06:09+00:00
FreshRSS actualize candrews...
PHP Fatal error:  Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''' at line 1 in /var/www/localhost/htdocs/FreshRSS/lib/Minz/Pdo.php:45
Stack trace:
#0 /var/www/localhost/htdocs/FreshRSS/lib/Minz/Pdo.php(45): PDO->exec()
#1 /var/www/localhost/htdocs/FreshRSS/app/Models/EntryDAO.php(167): Minz_Pdo->exec()
#2 /var/www/localhost/htdocs/FreshRSS/app/Controllers/feedController.php(505): FreshRSS_EntryDAO->commitNewEntries()
#3 /var/www/localhost/htdocs/FreshRSS/app/Controllers/feedController.php(548): FreshRSS_feed_Controller::actualizeFeed()
#4 /var/www/localhost/htdocs/FreshRSS/lib/Minz/Dispatcher.php(119): FreshRSS_feed_Controller->actualizeAction()
#5 /var/www/localhost/htdocs/FreshRSS/lib/Minz/Dispatcher.php(47): Minz_Dispatcher->launchAction()
#6 /var/www/localhost/htdocs/FreshRSS/lib/Minz/FrontController.php(81): Minz_Dispatcher->run()
#7 /var/www/localhost/htdocs/FreshRSS/app/actualize_script.php(75): Minz_FrontController->run()
#8 {main}
  thrown in /var/www/localhost/htdocs/FreshRSS/lib/Minz/Pdo.php on line 45
Results:
```
2021-01-11 22:28:35 +01:00
Alexandre Alapetite
ee7938ed5f Do not import feed causing DB error (#3347)
* Do not import feed causing DB error

The DB error might be that the new feed tries to redirect to an already
existing feed, in which case
#fix https://github.com/FreshRSS/FreshRSS/issues/3339

* Add feed bug
2021-01-09 20:51:33 +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
Alexis Degrugillier
022ed9912a Fix share option sort (#3331)
Before, share options were displayed in the order defined in the
configuration file. So the order reflected the share history and
was not really usable.
Now, share options are displayed in alphabetical order which makes
much more sense.
2021-01-03 20:15:15 +01:00
Alexandre Alapetite
9c6682e7ed Avoid manual initialisations of system or user configuration (#3070)
* Avoid manual intialisations of system or user configuration

More consistent use of Context

* Simplify FreshRSS_Context::initUser

* Remove a few manual get_user_configuration

* A bit of debugging

* Fix context user init

* Fix install

* Fix concurrency

Concurrent requests could lead to bad race condition

* Fix actualize cron

Fix case when system i initialised several times
2021-01-02 21:20:19 +01:00
Alexis Degrugillier
3f4c86f80f Add a file for each PDO class (#3301)
Before, we had 5 classes in the ModelPdo file. It was bad for 2 reasons.
The first reason is that it is considered bad practice to have multiple
class in one file. This is especially true when using autoloading. On top
of that it is less readable considering the size of the file. The second
reason is that so far we were lucky. Everytime we needed to access the
database, it was through the ModelPdo class which loads all the other
classes. If we want to access directly the connection, it wont be loaded.
On top of that, the system is configured to work on a single database,
but as we have every connection definition in a single file, all classes
were loaded at the same time. Thus using memory and processing time for
nothing.
Now, we have a file for each class. To work with autoloading, classes
were slightly renamed to match autoloading rules.
2020-12-29 00:11:34 +01:00
Alexandre Alapetite
0a2d9b3b54 Revert "Add a file for each PDO class (#3297)"
This reverts commit e1ee58816b.
2020-12-28 19:53:55 +01:00
Alexis Degrugillier
465b40f52d Add a file for each Auth class (#3298)
It's a follow-up of what was started in #3297.
2020-12-28 16:44:32 +01:00
Alexis Degrugillier
e1ee58816b Add a file for each PDO class (#3297)
Before, we had 5 classes in the ModelPdo file. It was bad for 2 reasons.
The first reason is that it is considered bad practice to have multiple
class in one file. This is especially true when using autoloading. On top
of that it is less readable considering the size of the file. The second
reason is that so far we were lucky. Everytime we needed to access the
database, it was through the ModelPdo class which loads all the other
classes. If we want to access directly the connection, it wont be loaded.
On top of that, the system is configured to work on a single database,
but as we have every connection definition in a single file, all classes
were loaded at the same time. Thus using memory and processing time for
nothing.
Now, we have a file for each class. To work with autoloading, classes
were slightly renamed to match autoloading rules.
2020-12-28 16:44:08 +01:00
Alexandre Alapetite
ac0d90c100 Auto-renew cookie (#3287)
#fix https://github.com/FreshRSS/FreshRSS/issues/3169#issuecomment-685983797
Supplement https://github.com/FreshRSS/FreshRSS/pull/3170

When we get the long-term login cookie (i.e. when starting a new session), renew it at the same time for the same duration
2020-12-28 13:09:57 +01:00
Martin
6ecfc01c1f bump default logout from 30 days to 3 months (#3170)
* bump default logout from 30 to 365 days

* * Change cookie duration to constant
* Change cookie duration to three months

* use class

* use 90 days (otherwise login form says 91.3 days)

* change class

* also this works now

Co-authored-by: Martin Rys <martin@rys.pw>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
2020-12-26 23:40:24 +01:00
Alexis Degrugillier
4abb30228b Fix user queries with labels (#3285)
Before user queries with labels were not translated. Actually, it was not
even processed.
Now those user queries are translated properly.

See #3215
2020-12-26 12:50:09 +01:00
Alexandre Alapetite
08a5cf5946 Ensure maximum date int (#3259)
#fix https://github.com/FreshRSS/FreshRSS/issues/3258
2020-11-23 23:04:06 +01:00
Prashant Tholia
6f23999c7b Remember open categories (#3185)
* feature(normal) - Remember opened categories in the left menu

Session storage based implementation to remember opened categories in left menu

Issue Ref: #2248

* lib_phpQuery updates

* Updates covering feedback points and functionality fixes

* Feedback updates

* Revert "lib_phpQuery updates"

This reverts commit dcd23b9418.

* First review

Change variable name to "remember" instead of "open".
Start using localStorage instead of sessionStorage.
Simplify code.

* Simplify remember categories init function

Replace 'session' with 'local' in function names and comment

Set open categories CSS as same as when category is opened in 'active' unfold mode

* Remove URLSearchParams check in remember categories init function

* Delete open categories on login and logout

* JSHint check fix

* Second review

* Make new mode the default for new users
* Always open active category
* Reduce / simplify code

* i18n French

* Revert default value

Wait a bit more for this decision / change

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-11-02 12:03:16 +01:00
Alexandre Alapetite
f33e261163 Fix sanitize feed description (#3222)
* Fix sanitize feed description

#fix https://github.com/FreshRSS/FreshRSS/issues/3221

* Simplification
2020-10-11 13:32:23 +02:00
Alexandre Alapetite
0319cc9d23 Minz allow parallel sessions (#3096)
* Minz allow parallel sessions

#fix https://github.com/FreshRSS/FreshRSS/issues/3093

* Array optimisation

* Array optimisation missing

* Reduce direct access to $_SESSION except in install process

* Fix session start headers warning

* Use cookie only the first time the session is started:
`PHP Warning:  session_start(): Cannot start session when headers
already sent in /var/www/FreshRSS/lib/Minz/Session.php on line 39`

* New concept of volatile session for API calls

Optimisation: do not use cookies or local storage at all for API calls
without a Web session
Fix warning:

```
PHP Warning:  session_destroy(): Trying to destroy uninitialized session
in Unknown on line 0
```

* Only call Minz_Session::init once in our index

It was called twice (once indirectly via FreshRSS->init())

* Whitespace

* Mutex for notifications

Implement mutex for notifications
https://github.com/FreshRSS/FreshRSS/pull/3208#discussion_r499509809

* Typo

* Install script is not ready for using Minz_Session
2020-10-06 23:19:45 +02:00
Alexandre Alapetite
be5f9f2dce When ssl_verify is false, decrease SSL security (#3171)
When ssl_verify option is set to false for a feed, allow lower security such as SHA-1 signatures.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=900984
https://stackoverflow.com/questions/58342699/php-curl-curl-error-35-error1414d172ssl-routinestls12-check-peer-sigalgwr
Fix error of type `cURL error 35: error:1414D172:SSL routines:tls12_check_peer_sigalg:wrong signature`
Example of feeds:
https://www.version2.dk/it-nyheder/rss
https://ing.dk/rss/nyheder
2020-09-03 10:35:23 +02:00
Alexandre Alapetite
6fac0e40c4 Fix tag in user query (#3168)
* Fix tag in user query

#fix https://github.com/FreshRSS/FreshRSS/issues/3163

* Fix Travis
2020-09-02 08:55:43 +02:00
Luc SANCHEZ
ca965a490d Fix variable undeclared ($sql) (#3165)
* Fix variable undeclared ($sql)

* Update DatabaseDAOSQLite.php

modify
2020-09-01 12:50:00 +02:00
Alexis Degrugillier
ee31722072 Change feed order in a category (#3131)
Before, the sorting was not human readable. Lower-cased feed names were
displayed after upper-cased feed names.
Now, the sorting is human readable. The sorting is done without taking into
account the name case.

See #3128
2020-08-05 09:40:58 +02:00
Alexandre Alapetite
c523f5a4e7 Relaxed to allow underscore _ in URL hostnames (#3133)
* Relaxed to allow underscore _ in URL hostnames

#fix https://github.com/FreshRSS/FreshRSS/issues/3132
https://bugs.php.net/bug.php?id=64948

* Minor fix in favicons redirect

* Minor fix in relative HREF for favicons
2020-07-31 16:33:45 +02:00
Alexis Degrugillier
909fdaca31 Add tag management page (#3121)
The new page allows to create, delete and rename tags.

See #3058
2020-07-23 11:31:38 +02:00
Alexis Degrugillier
8d8211b2a5 Add machine-readable dates in views (#3106)
This will allow to make some transformations on dates when needed.
See #3103 and #853
2020-07-14 10:51:45 +02:00
Alexandre Alapetite
3f9518b377 Hide feed credentials when adding a new feed (#3099)
Avoid showing HTTP Basic Auth credentials in feed error log and in feed
title (when there is no title provided)
2020-07-07 10:54:28 +02:00
bpatath
5c9d6a5396 Add auto-registration when using http_auth (#3003)
* Add auto-registration when using http_auth

* Document HTTP auth auto-registration

* Check email variable for HTTP auth auto-registration

* Auto-create HTTP users by default

* Fix Context init

(I will provide in another PR a better fix requiring a bit of global refactoring)

* Init language

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-06-19 23:01:19 +02:00
Alexandre Alapetite
6edbeaaf6a Add error log (#3055)
For https://github.com/FreshRSS/FreshRSS/issues/3054
2020-06-13 21:19:19 +02:00
Alexis Degrugillier
d4554fa087 Change add feed action (#3027)
* Docker Alpine 3.12 (#3025)

https://alpinelinux.org/posts/Alpine-3.12.0-released.html
With PHP 7.3.18 (from 7.3.17) (and Apache 2.4.43 unchanged).
No other significant change spotted

* Ensure feed attributes are used before load

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2020-06-05 10:09:31 +02:00
Alexandre Alapetite
e58ad65902 Fix display_categories upgrade from 1.16.0 again (#3019)
* Fix display_categories upgrade from 1.16.0 again

#fix https://github.com/FreshRSS/FreshRSS/issues/3017
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/3018
There were two bugs. I forgot that `ConfigurationSetter.php` is not
called when reading `config.php`

* Changelog 3019
2020-05-30 22:48:00 +02:00
Alexandre Alapetite
f6bfcba827 Fix display_categories upgrade from 1.16.0 (#3018)
* Fix display_categories upgrade from 1.16.0

#fix https://github.com/FreshRSS/FreshRSS/issues/3017
The property `'display_categories' => boolean,` in 1.16.0 is not properly converted to `'display_categories' => 'string',` in 1.16.1 due to a weak type comparison bug.
2020-05-30 21:06:46 +02:00