Take advantage of PHP7+ null-coalescing operator `??` to make code more standard, shorter, and faster instead of custom function with no extra functionality.
Allows code to be better tested and fix two PHPstan errors:
```
------ -----------------------------------------
Line app/Controllers/configureController.php
------ -----------------------------------------
410 Cannot unset offset 'rid' on string.
------ -----------------------------------------
------ ------------------------------------
Line lib/Minz/FrontController.php
------ ------------------------------------
70 Cannot unset offset 'c' on string.
71 Cannot unset offset 'a' on string.
------ ------------------------------------
```
https://github.com/FreshRSS/FreshRSS/issues/4016
Before, only the user configuration was supported by extensions. But it was
limiting if one has to create a system extension with configuration.
Now, both user and system configuration are supported.
* git update auto change to edge branch
For existing installations using automatic git update, checkout *edge* branch if it was still using *master* or *dev*.
* One more prune
* Fix several small issues
* theirs does not work here
* Use migration mechanism
* Better handling of Migration errors
* Test details
* Fix tests
* Do not use new migration system for now
* Remove file data/do-install.txt
This file was painful during update because we had to remember to delete
it each time. It added a security issue by allowing an attacker to
reinstall FreshRSS during the update process.
The (more powerful) file data/applied_migrations.txt has been introduced
in 8619cf6fa to replace do-install.txt. We had to wait for at least one
release in order to make sure existing instances of FreshRSS created the
migration file. It should be ok now.
* Replace i18n install.not_deleted key
* Update documentation to update FreshRSS
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/
#fix https://github.com/FreshRSS/FreshRSS/pull/3546
When `loadHTML()` is given a null or empty string.
```
PHP Fatal error: Uncaught ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in /var/www/freshrss/lib/SimplePie/SimplePie/Locator.php:83
```
Before, only standard shortcuts were supported. When other shortcuts were
configured, they were filtered out.
Now, those shortcuts are stored in the configuration and an alert message
is displayed to alert the user that he is using non-standard shortcuts.
See #3481
* 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
* fix: handle big xml files which cause out of memory exceptions by working with chunks in cleanMd5 function (because of preg_replace) and parse (because of xml_parse)
* Review
* Fixes in error handling (case of the last call to xml_parse, case of
error during fopen, break in case of XML error...)
* Takes advantage of the chunking for computing the cache hash
* Larger chunks of 1MB
Co-authored-by: e <bokes74743@tjuln.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Before, setting values did not refresh the configuration cache. Thus
generating some weird behavior when configuring extensions.
Now, the cache is updated with the most recent values when the
configuration is modified.
Fix regression from https://github.com/FreshRSS/FreshRSS/pull/3407
Identifier must not be indented
PHP 5.6.36 (cli) (built: Apr 28 2018 21:14:51)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend
Technologies
PHP Parse error: syntax error, unexpected end of file in
lib/lib_rss.php on line 608
Errors parsing lib/lib_rss.php
* 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
* Better error message
* inconsistent dot with the other message
* Better error message
* add errorMessage()
* fix style
* html escape the error title
* also html escape error message
* remove spaces before parentheses
* rework the error message
* Minz-friendly
* Update message
Do not advise running this script as wrong user
* Update lib/lib_rss.php
Co-authored-by: Martin <spleefer90@gmail.com>
Co-authored-by: Martin Rys <martin@rys.pw>
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
This will simplify extension code by removing a lot of logic from
the extension itself when it's not needed. I've tested it on one
of my extension with all the other recent extension modifications
and I could remove half of the code needed before.
Before, only one extension could be configured at a time. Thus we
were loosing the configuration for other extensions when saving.
Now, each extension can be saved without overriding data.
See #3397
Before, the extension configuration was handled by its author. There
was discrepancies between extensions on how the configuration was
stored.
Now, we could rely on a single way of storing configuration. This won't
invalidate how the extensions are storing their configuration but will
allow authors to focus on what is important.