RPi_Cam_Web_Interface icon indicating copy to clipboard operation
RPi_Cam_Web_Interface copied to clipboard

Missing 4th parameter in userbuttons causes entries in error log

Open ras07 opened this issue 5 years ago • 1 comments

The userbuttons file can have a semi-optional 4th parameter, which represents "other attributes" (width, etc). If this parameter is missing it results in a message in /var/log/apache2/error.log that says:

[php7:notice] [pid 521] [client 11.22.33.44:5555] PHP Notice: Undefined offset: 3 in /var/www/html/index.php on line 58

This doesn't appear to cause any real problems other than filling up the error log. Line 58 in index.php is simply: $otherAtt = $index[3]; I think something like: if (count($index) > 3) { $otherAtt = $index[3]; } else { $otherAtt = ""; } would suppress this error. (Sorry for the ugly format; I can't seem to make Github respect linefeeds inside code blocks)

I'm not sure what an empty $otherAtt does to the functions that eventually use $buttonString, so that bears some consideration.

ras07 avatar Feb 19 '20 02:02 ras07

Thanks. I have made that change. I think an empty otherAtt is OK.

roberttidey avatar Feb 19 '20 09:02 roberttidey