Unable to load firewall rules.
-
When I try to load/view the firewall rules, it crashes with 50x error code,
PHP ERROR: Type: 1, File: /etc/inc/util.inc, Line: 3412, Message: Uncaught TypeError: format_number(): Argument #1 ($num) must be of type int, float given, called in /usr/local/www/firewall_rules.php on line 125 and defined in /etc/inc/util.inc:3412 Stack trace: #0 /usr/local/www/firewall_rules.php(125): format_number() #1 /usr/local/www/firewall_rules.php(534): print_states() #2 {main}I did some digging into this, and found that the format_number function from
/etc/inc/util.inc
expects an int, and a precision as an int. It seems very odd to me that it would need a precision value, it it only accepts an int. That, combined with the fact that it is being passed a float, which is what causes this crash makes me think that this is a bug in that function. the full function is belowfunction format_number(int $num, int $precision = 3): string { $units = ['', 'K', 'M', 'G', 'T']; for ($i = 0; $num >= 1000; $i++) { $num /= 1000; } return (round($num, $precision) . $units[$i]); }I was going to submit a bug report, but when I looked up where to do so, I was adamantly informed that I needed to post here first.

-
@VersatusOmni hmm havenāt run into this. Isnāt $num in bytes? Not sure how that gets to be a float. If you reboot or otherwise clear states I bet it disappearsā¦
-
@VersatusOmni said in Unable to load firewall rules.:
and found that the format_number function from
?
A couple of days (week ?) ago, there was an issue with the number_format(), and now also the format_number() function. What a coincidence./usr/local/www/firewall_rules.php on line 125 ; $evaluations , and also $states, can / is only be an int, not a float.
It's the format_number() function that makes :

for example, see the "evaluation: 1.06M" line.
The real content of $evaluation (for me, right now) was 1061123, and this an int, as the number of evaluation can only be an int. states also.What pfSense version are you using ?
edit : or did you manage to create more evaluations then that what can be hold in an int ?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better š
Register LoginPrivacy Policy · Cookie Policy