Skip to content

Commit f3aceb4

Browse files
committed
Fix an error when disabling all user plugins
If I enabled some user plugins via Preferences -> Plugins and then disabled all of them, an error occurred: Jul 16 22:34:20 php[100]: PHP Fatal error: Uncaught TypeError: array_filter(): Argument torne#1 ($array) must be of type array, null given in /usr/share/webapps/tt-rss/classes/pref/prefs.php:1027 Jul 16 22:34:20 php[100]: Stack trace: Jul 16 22:34:20 php[100]: #0 /usr/share/webapps/tt-rss/classes/pref/prefs.php(1027): array_filter() Jul 16 22:34:20 php[100]: torne#1 /usr/share/webapps/tt-rss/backend.php(136): Pref_Prefs->setplugins() Jul 16 22:34:20 php[100]: torne#2 {main} Jul 16 22:34:20 php[100]: thrown in /usr/share/webapps/tt-rss/classes/pref/prefs.php on line 1027 Apparently the issue was elevated from a warning to an error in PHP 8.0 [1]. [1] https://php.watch/versions/8.0/internal-function-exceptions
1 parent fdd1c43 commit f3aceb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

classes/pref/prefs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ function otpdisable(): void {
10241024
}
10251025

10261026
function setplugins(): void {
1027-
$plugins = array_filter($_REQUEST["plugins"], 'clean') ?? [];
1027+
$plugins = array_filter($_REQUEST["plugins"] ?? [], 'clean');
10281028

10291029
set_pref(Prefs::_ENABLED_PLUGINS, implode(",", $plugins));
10301030
}

0 commit comments

Comments
 (0)