Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when installing e2guardian on a fresh install of pfSense #111

Open
CocoBanane55 opened this issue May 17, 2023 · 1 comment
Open

Comments

@CocoBanane55
Copy link

Hello,

First of all thanks you to give us an Unofficial e2guardian on pfSense.

When I want to install e2guardian, after patching the system, it give me this error :

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /usr/local/www/e2guardian.php:171
Stack trace:
#0 /usr/local/www/e2guardian.php(77): read_lists(false, 'Found a clean i...')
#1 /usr/local/pkg/e2guardian.inc(2091): fetch_blacklist(false, true)
#2 /etc/inc/pkg-utils.inc(781) : eval()'d code(3): e2guardian_php_install_command(false, true)
#3 /etc/inc/pkg-utils.inc(781): eval()
#4 /etc/inc/pkg-utils.inc(899): eval_once('update_status("...')
#5 /etc/rc.packages(76): install_package_xml('E2guardian5')
#6 {main}
thrown in /usr/local/www/e2guardian.php on line 171
PHP ERROR: Type: 1, File: /usr/local/www/e2guardian.php, Line: 171, Message: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /usr/local/www/e2guardian.php:171
Stack trace:
#0 /usr/local/www/e2guardian.php(77): read_lists(false, 'Found a clean i...')
#1 /usr/local/pkg/e2guardian.inc(2091): fetch_blacklist(false, true)
#2 /etc/inc/pkg-utils.inc(781) : eval()'d code(3): e2guardian_php_install_command(false, true)
#3 /etc/inc/pkg-utils.inc(781): eval()
#4 /etc/inc/pkg-utils.inc(899): eval_once('update_status("...')
#5 /etc/rc.packages(76): install_package_xml('E2guardian5')
#6 {main}
thrownpkg-static: POST-INSTALL script failed

Debug information:
I'm on pfSense 23.01 based on FreeBSD 14 RELEASE (pfSense+ subscription for non-profit organization).
I take the patch for 2.7 version as it is based on FreeBSD 14 too (maybe the problem I prefer to notice)

Thanks you in advance for you help

@r4phf43l
Copy link

For me, I just replace the line 171:

if (count($config['installedpackages']['e2guardianblacklistsdomains']['config']) > 18) {

for this:

if (($config['installedpackages']['e2guardianblacklistsdomains']['config'] != null) && (count($config['installedpackages']['e2guardianblacklistsdomains']['config']) > 18)) {

pfSense 23.05.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants