Bug #15365
closedpfBlockerNG PHP error when editing a list
100%
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
Related issues
Updated by Danilo Zrenjanin 8 months ago
- File clipboard-202403280951-tqfxp.png clipboard-202403280951-tqfxp.png added
- Status changed from New to Confirmed
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.
Updated by Glenn Hall 8 months ago
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.
Updated by Christopher Cope 7 months ago
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.
Updated by Christopher Cope 7 months ago
- Status changed from Confirmed to Pull Request Review
- Assignee set to Christopher Cope
Updated by Jim Pingle 7 months ago
- Target version deleted (
2.8.0) - Plus Target Version deleted (
24.03)
Updated by Mike Moore 7 months ago
Any luck getting the PR merged?
I cant update any of my feeds without it.
Updated by Nizam Moidu 7 months ago
- File pfblocker-range.patch pfblocker-range.patch added
you can try system patch
Updated by Danilo Zrenjanin 7 months ago
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
Updated by Mike Moore 7 months ago
i dont know how to add the patch from the screen shot.
I am hoping it can be available through the package manager.
Updated by Jim Pingle 7 months ago
- Related to Bug #15444: Since this update 24.03-RELEASE was installed, PFBlockerNG has not been functioning correctly. added
Updated by Mike Moore 7 months ago
ive added the fixes manually and confirmed all is well.
Any reason why this hasn't been pushed out via the repo?
Updated by Jim Pingle 7 months ago
- 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.