Project

General

Profile

Actions

Bug #14004

closed

PHP errors when configuration lacks any certificates

Added by Steve Wheeler almost 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Certificates
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.05
Release Notes:
Default
Affected Version:
2.7.0
Affected Architecture:
All

Description

When visiting the DNS resolver config page without any certs present:

Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /usr/local/www/services_unbound.php:70 
Stack trace: 
#0 {main} 
   thrown in /usr/local/www/services_unbound.php on line 70 
PHP ERROR: Type: 1, File: /usr/local/www/services_unbound.php, Line: 70, Message: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /usr/local/www/services_unbound.php:70

See: https://forum.netgate.com/topic/178037/fatal-error-uncaught-typeerror-at-dns-resolver-page

Actions #1

Updated by Jim Pingle almost 2 years ago

  • Category changed from Web Interface to DNS Resolver
  • Assignee set to Jim Pingle
Actions #2

Updated by Jim Pingle almost 2 years ago

  • Subject changed from PHP ERROR: /usr/local/www/services_unbound.php:70 to PHP errors when configuration lacks any certificates
  • Category changed from DNS Resolver to Certificates

I spotted a couple other areas outside of the resolver that had a similar call in the code to here, where if there were no certificates it may get null instead of an array.

The commit I just pushed should account for all of these.

Actions #3

Updated by Jim Pingle almost 2 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #4

Updated by Danilo Zrenjanin almost 2 years ago

Tested the patch against:

23.01-RELEASE (amd64)
built on Fri Feb 10 20:06:33 UTC 2023
FreeBSD 14.0-CURRENT

It works fine. I am marking this ticket resolved.

Actions #5

Updated by Danilo Zrenjanin almost 2 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF