aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2021-05-18Add a request method to extract arrays (#3629)Gravatar Alexis Degrugillier
2021-05-16Minz provide action name in controller exception (#3624)Gravatar Alexandre Alapetite
Contributes to https://github.com/FreshRSS/FreshRSS/issues/3584
2021-05-15git update auto change to edge branch (#3589)Gravatar Alexandre Alapetite
* 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
2021-05-08Fix several comments syntaxes (#3615)Gravatar Alexandre Alapetite
Mainly wrong `@return` types in comments
2021-05-08Merge upstream SimplePie PR details (#3614)Gravatar Alexandre Alapetite
https://github.com/simplepie/simplepie/pull/681 https://github.com/simplepie/simplepie/pull/680 https://github.com/simplepie/simplepie/pull/675
2021-04-17Show start error (#3590)Gravatar Alexandre Alapetite
* Show start error #fix https://github.com/FreshRSS/FreshRSS/issues/3581 We were not showing the actual error for several types of exceptions, e.g. database connection error. Possible regression since https://github.com/FreshRSS/FreshRSS/pull/3407 * Try to make the error message less confusing
2021-04-17Merge SimplePie changes (#3588)Gravatar Alexandre Alapetite
Related to https://github.com/simplepie/simplepie/pull/676 from https://github.com/FreshRSS/FreshRSS/pull/1087
2021-04-08Fix wrong SimplePie type hint (#3578)Gravatar Alexandre Alapetite
`SimplePie_Cache` also exists but is something else.
2021-03-28SimplePie fix old regression during manual merge (#3568)Gravatar Alexandre Alapetite
Bug from https://github.com/FreshRSS/FreshRSS/pull/2136 Related upstream PR https://github.com/simplepie/simplepie/pull/676
2021-03-26tec: Remove data/do-install.txt (#3555)Gravatar berumuron
* 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
2021-03-26Suport standard HTTP 410 Gone (#3561)Gravatar Alexandre Alapetite
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-23SimplePie fix PHP8 uncatched error (#3547)Gravatar Alexandre Alapetite
#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 ```
2021-03-21Remove shortcut validation (#3548)Gravatar Alexis Degrugillier
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
2021-03-09SimplePie prevent cache pollution (#3502)Gravatar Alexandre Alapetite
* 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-02-28Travis: Enforce phpcs line length + whitespace (#3488)Gravatar Alexandre Alapetite
* 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-26Add support for extension user files (#3433)Gravatar Alexis Degrugillier
Extension user files can be stored easily in the user folder instead of the static folder.
2021-02-24Upgrade PHPMailer to 6.3.0 (#3457)Gravatar Brooke
* Upgrade PHPMailer to 6.2.0 * Bump PHPMailer to 6.3.0 Co-authored-by: berumuron <dev@marienfressinaud.fr>
2021-02-20Manual update to SimplePie 1.5.6 (#3469)Gravatar Alexandre Alapetite
* Manual update to SimplePie 1.5.6 Follow-up of https://github.com/FreshRSS/FreshRSS/pull/3206 (1.5.5) Differences https://github.com/simplepie/simplepie/compare/692e8bc19bc4aca20b57474cca2a1d234ce89d63...155cfcfacdbf7ee4e9cbb837e70564cdd6a40ac0 Related to https://github.com/FreshRSS/FreshRSS/pull/3416 , https://github.com/FreshRSS/FreshRSS/pull/3404 * Typo
2021-02-17Fix: handle very big feed (#3416)Gravatar Kiblyn11
* 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>
2021-02-17Add user maintenance hooks (#3440)Gravatar Alexis Degrugillier
The new hook allows to add maintenance extensions at the user level. See #3398
2021-02-11Remove Minz validation (#3439)Gravatar Alexis Degrugillier
It should have been done during #3302.
2021-02-11refactor: remove referer checks, as they are no longer needed (replaced by ↵Gravatar hesch
csrf tokens) (#3432)
2021-02-08Fix configuration local cache (#3431)Gravatar Alexis Degrugillier
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.
2021-02-06API implement OPML import/export (#3424)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/3421
2021-02-06Fix heredoc syntax (#3426)Gravatar Alexandre Alapetite
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
2021-02-06Fix return type for broken feeds (#3423)Gravatar Alexandre Alapetite
Fix a rare error when an invalid feed is forced to be added again. FreshRSS code (not upstream)
2021-02-05Add requirements check in CLI (#3410)Gravatar Alexandre Alapetite
* Add requirements check in CLI #fix https://github.com/FreshRSS/FreshRSS/issues/1853 * More checks #fix https://github.com/FreshRSS/FreshRSS/issues/1853
2021-02-05Better error message on failure (#3407)Gravatar Martin
* 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>
2021-02-05Add a method to retrieve a configuration value (#3422)Gravatar Alexis Degrugillier
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.
2021-02-02Fix user configuration in extension (#3412)Gravatar Alexis Degrugillier
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
2021-02-02Add comprehensive user configuration in extensions (#3397)Gravatar Alexis Degrugillier
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.
2021-01-31PHP8: SimplePie wrong use of isset (#3404)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/3401 (crash with PHP 8+) `ceil()` crashes in PHP8+ in case of invalid input such as empty string. `intval()` fixes the problem with almost identical behaviour than `ceil()` in PHP7- (except for floating point values) #fix FreshRSS/FreshRSS#3401 (crash with PHP 8+) Example with feed http://podcast.hr2.de/derTag/podcast.xml ```xml <enclosure url="https://mp3podcasthr-a.akamaihd.net:443/mp3/podcast/derTag/derTag_20210129_87093232.mp3" length="" type="audio/mpeg"/> ``` `isset("")` passes and then `ceil("")` crashes due to wrong type in PHP8+: ``` Uncaught TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given in ./SimplePie/SimplePie/Item.php:2871 ``` Upstream patch https://github.com/simplepie/simplepie/pull/670
2021-01-30Explicit PDO::ERRMODE_SILENT (#3408)Gravatar Alexandre Alapetite
`PDO::ERRMODE_SILENT` is the default value https://php.net/pdo.error-handling We just make it explicit #fix https://github.com/FreshRSS/FreshRSS/issues/3402 But in the issue above, it looks like it is in `PDO::ERRMODE_EXCEPTION` mode
2021-01-17Curlopt fixes (#3381)Gravatar Eris
* sort results in find() method * Update lib/lib_phpQuery.php Co-Authored-By: Alexandre Alapetite <alexandre@alapetite.fr> * Update lib/lib_phpQuery.php Co-Authored-By: Alexandre Alapetite <alexandre@alapetite.fr> * Fix fetching articles Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2021-01-16CURLOPT parameters per feed (#3367)Gravatar Eris
* 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-14Add constant for PHP requirements (#3369)Gravatar Alexis Degrugillier
* Add constant for PHP requirements This new constant is used for PHP version check. This way, we won't forget to modify some part of the code base. * Remove PHP version checks Some checks were obsolete because they were checking unsupported PHP versions.
2021-01-11Possiblity to autoinstall in Docker Compose (#3353)Gravatar Alexandre Alapetite
* Possiblity to autoinstall in Docker Compose #fix https://github.com/FreshRSS/FreshRSS/issues/3349 It is simply calling our existing CLI: do-install.php and create-user.php https://github.com/FreshRSS/FreshRSS/tree/master/cli FreshRSS will typically be ready a few seconds before the database, so introduce a tolerance when the database is not available / up (yet) by trying a few times to connect. Also useful to avoid service interruption when DB service is restarted. Example: ```yml freshrss-app: image: freshrss/freshrss container_name: freshrss-app hostname: freshrss-app restart: unless-stopped ports: - "8080:80" depends_on: - freshrss-db volumes: - data:/var/www/FreshRSS/data - extensions:/var/www/FreshRSS/extensions environment: CRON_MIN: '*/20' FRESHRSS_ENV: development FRESHRSS_INSTALL: |- --api_enabled --base_url https://rss.example.net --db-base freshrss --db-host freshrss-db --db-password freshrss --db-type pgsql --db-user freshrss --default_user admin --language en FRESHRSS_USER: |- --api_password freshrss --email user@example.net --language en --password freshrss --user admin TZ: Europe/Paris ``` * Minor type f in find * shellcheck
2021-01-09Add class autoload for extension (#3350)Gravatar Alexis Degrugillier
When an extension defines an `autoload` method, it will be registered automatically before enabling the extension. For the extension creator, it's easier because there is no need to register it manually.
2021-01-07two new hooks (#3342)Gravatar Clemens Neubauer
* 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-07Change base extension class type (#3333)Gravatar Alexis Degrugillier
Before, there were some guidelines on how to use the extension class and how to extend it. Those guidelines were defined as comments. Now, those guidelines are enforced by the code itself. There is no need for those comments anymore.
2021-01-04Add a deprecation log error for extensions (#3335)Gravatar Alexis Degrugillier
Extensions must override some parent methods. The rule is just a guideline because only described in comments. The idea is to deprecate that flexibility and add it to the code. To warn users beforehand, we log error message regarding incomplete extensions. See #3333
2021-01-03Fix author search link (#3315)Gravatar Alexis Degrugillier
Before, when clicking on the author link, the search was done on the main stream in the normal view. It's fine until the feed is not visible in the main stream. Now, the current context is used along with the search. See #3314
2021-01-02Avoid manual initialisations of system or user configuration (#3070)Gravatar Alexandre Alapetite
* 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-02Add temp folder check during install (#3312)Gravatar Alexis Degrugillier
Before, the temp path was not check during install. With some configuration, FRSS was not working because of a non-writable temp directory. It happened with XAMPP on MacOS X but it might be the case for other platforms. Now, the temp path is checked during install to make sure it is writable. See #3310
2020-12-29Remove Minz validation during install. (#3302)Gravatar Alexis Degrugillier
As FRSS always comes with Minz, there is no need to validate that it is there during install. If it turns out we need to validate that, we might need to validate other libraries as well.
2020-12-29Add a file for each PDO class (#3301)Gravatar Alexis Degrugillier
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-28Revert "Add a file for each PDO class (#3297)"Gravatar Alexandre Alapetite
This reverts commit e1ee58816ba76734e4115fc12898b13de665b220.
2020-12-28Revert "Extract autoloading process (#3283)"Gravatar Alexandre Alapetite
This reverts commit 46cb89adf842e2fbac254fc99355d6577e4e86eb.
2020-12-28Add a file for each PDO class (#3297)Gravatar Alexis Degrugillier
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-28SimplePie Strip comments (#3288)Gravatar Alexandre Alapetite
#fix https://github.com/FreshRSS/FreshRSS/issues/3282 (workaround an nginx configuration bug) We do not need to keep HTML comments in RSS content.