Project

General

Profile

Actions

Bug #11898

closed

PHP error from apcupsd dashboard widget when battery is charging

Added by Jim Pingle over 3 years ago. Updated almost 2 years ago.

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

100%

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)) { 

Related issues

Related to Regression #13970: PHP error in apcupsd widget from UTF-8 string handlingResolvedJim Pingle

Actions
Actions

Also available in: Atom PDF