Bug #14036
closed
PHP error when the ``timeserver`` section of the configuration is empty
Added by Christopher Cope over 1 year ago.
Updated over 1 year ago.
Plus Target Version:
23.05
Description
The following error is thrown when there is an empty or missing "timeserver" entry in the config.
The code should check for the above situation(s).
[25-Feb-2023 16:46:09 Etc/UTC] PHP Fatal error: Uncaught ValueError: substr_count(): Argument #2 ($needle) cannot be empty in /etc/inc/system.inc:2023
Stack trace:
#0 /etc/inc/system.inc(2023): substr_count('', '')
#1 /etc/rc.bootup(356): system_ntp_configure()
#2 {main}
thrown in /etc/inc/system.inc on line 2023
- Target version set to 2.7.0
- Plus Target Version set to 23.05
- Assignee set to Jim Pingle
I don't see how anyone would get it into this state without manual config editing. Neither system.php nor the NTP config page allow you to save an empty list.
That said, if I clear out the list in my config (<timeservers></timeservers>
) then I can reproduce the error.
- Status changed from New to Feedback
- % Done changed from 0 to 100
- Status changed from Feedback to Resolved
I could replicate the issue on the:
23.01-RELEASE (amd64)
built on Fri Feb 10 20:06:33 UTC 2023
FreeBSD 14.0-CURRENT
The patch fixes it successfully. I am marking this ticket resolved.
- Subject changed from PHP error when missing timeserver in config to PHP error when the ``timeserver`` section of the configuration is empty
Updating subject for release notes.
- Affected Version set to 2.7.0
Also available in: Atom
PDF