Bug #15365
closed
pfBlockerNG PHP error when editing a list
Added by Steve Wheeler 9 months ago.
Updated 8 months ago.
Affected Plus Version:
24.03
Description
When editing an IPv4 list item I hit:
PHP Errors:
[27-Mar-2024 15:22:03 Europe/London] PHP Fatal error: Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391
Stack trace:
#0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range(1, 17, -1)
#1 {main}
thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391
Looks like others have hit it editing other lists.
Tested:
pfSense-24.03.b.20240322.1708
pfSense-pkg-pfBlockerNG-3.2.0_9
Files
I can confirm this behavior.
Crash report begins. Anonymous machine information:
amd64
15.0-CURRENT
FreeBSD 15.0-CURRENT #0 plus-devel-main-n256297-0a9899b0f3e: Fri Mar 22 17:45:50 UTC 2024 root@freebsd:/var/jenkins/workspace/pfSense-Plus-snapshots-master-main/obj/amd64/WamqD8YQ/var/jenkins/workspace/pfSense-Plus-snapshots-master-main/sources/FreeBS
Crash report details:
PHP Errors:
[28-Mar-2024 08:50:51 Etc/UTC] PHP Fatal error: Uncaught ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges in /usr/local/www/pfblockerng/pfblockerng_category_edit.php:391
Stack trace:
#0 /usr/local/www/pfblockerng/pfblockerng_category_edit.php(391): range(1, 17, -1)
#1 {main}
thrown in /usr/local/www/pfblockerng/pfblockerng_category_edit.php on line 391
No FreeBSD crash data found.
I can also confirm this behavior. I corrected it in my setup by editing line 391 of /usr/local/www/pfblockerng/pfblockerng_category_edit.php by changing the "range(1, 17, -1)" to "range(1, 17, 1)". This stopped the PHP error from occurring and allowed me to edit the DNSBL's again. I do not know if my change has other implications, although I have noticed no other issues since doing it.
This is due to a change in behavior with the range function as of PHP 8.3.0 https://www.php.net/manual/en/function.range.php
The correct solution is the edit to a positive 1, which would have the same output as the previous call on the older versions of PHP. I'll have a merge request together shortly.
- Status changed from Confirmed to Pull Request Review
- Assignee set to Christopher Cope
- Target version deleted (
2.8.0)
- Plus Target Version deleted (
24.03)
Any luck getting the PR merged?
I cant update any of my feeds without it.
I've tested the patch against the:
24.03-RELEASE (amd64)
built on Wed Apr 24 17:38:00 UTC 2024
FreeBSD 15.0-CURRENT
After applying the patch, I was able to edit both the DNSBL Groups and IPv4 addresses.
It fixes what is reported here as well:
https://redmine.pfsense.org/issues/15419
There are actually 2 spots where this can cause an error. The pull request addresses both. The patch attached reflects the pull request.
i dont know how to add the patch from the screen shot.
I am hoping it can be available through the package manager.
- Related to Bug #15444: Since this update 24.03-RELEASE was installed, PFBlockerNG has not been functioning correctly. added
ive added the fixes manually and confirmed all is well.
Any reason why this hasn't been pushed out via the repo?
- Status changed from Pull Request Review to Resolved
- % Done changed from 0 to 100
PR merged, updated package should be available now on 24.03.
Also available in: Atom
PDF