Project

General

Profile

Actions

Bug #11898

open

PHP error from apcupsd dashboard widget

Added by Jim Pingle 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
apcupsd
Target version:
-
Start date:
05/07/2021
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
Affected Architecture:

Description

Not clear exactly what led to this, but one of my systems running apcupsd had the following PHP error in its log:

[04-May-2021 09:57:13 America/Indiana/Indianapolis] PHP Warning:  strrpos(): needle is not a string or an integer in /usr/local/www/widgets/widgets/apcupsd.widget.php on line 130

The same error was repeated about 90 times over a span of 20 minutes, about 15 seconds apart which is around when the widget would be updating. There must have been some data that was returned at the time which it had trouble parsing.

pfSense-pkg-apcupsd-0.3.91_9

The line in question is:

                    if (($bchrg != null) && (in_array("ONLINE", $statusarray)) && ($bchrg < 100) && (strrpos($statstr, $mainstatarray) === false)) { 

No data to display

Actions

Also available in: Atom PDF