RPi_Cam_Web_Interface
RPi_Cam_Web_Interface copied to clipboard
Missing 4th parameter in userbuttons causes entries in error log
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.
Thanks. I have made that change. I think an empty otherAtt is OK.