From a2ab9cf83aaead96497a70a1430ce0424c0d8316 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 2 Dec 2021 23:25:07 +0100 Subject: Minz request avoid custom methods (#4020) 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 --- app/Controllers/feedController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Controllers/feedController.php') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index afb05f17e..c94b3216a 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -566,7 +566,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $url = Minz_Request::param('url'); $force = Minz_Request::param('force'); $maxFeeds = (int)Minz_Request::param('maxFeeds'); - $noCommit = Minz_Request::fetchPOST('noCommit', 0) == 1; + $noCommit = ($_POST['noCommit'] ?? 0) == 1; if ($id == -1 && !$noCommit) { //Special request only to commit & refresh DB cache $updated_feeds = 0; -- cgit v1.2.3