Project

General

Profile

Bug #9095

PHP error when saving logs with empty syslog tag

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

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Logging
Target version:
Start date:
11/05/2018
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Default
Affected Version:
2.4.4
Affected Architecture:
All

Description

If config.xml contains no log settings, but has an empty syslog section (<syslog></syslog>) this can lead to a PHP error when saving settings on an individual log tab:

For example, with the above tag in the config, go to Status > System Logs, click the wrench, change the number of lines to show to another value such as 75, then click Save. The following errors will be logged and the save will fail:

[05-Nov-2018 14:41:37 America/Indiana/Indianapolis] PHP Warning:  Illegal string offset 'system_settings' in /usr/local/www/status_logs_common.inc on line 668
[05-Nov-2018 14:41:37 America/Indiana/Indianapolis] PHP Fatal error:  Uncaught Error: Cannot use string offset as an array in /usr/local/www/status_logs_common.inc:668
Stack trace:
#0 /usr/local/www/status_logs.php(84): manage_log_code()
#1 {main}
  thrown in /usr/local/www/status_logs_common.inc on line 668

Associated revisions

Revision 4c4e294b (diff)
Added by Jim Pingle over 2 years ago

Prevent PHP error when saving log config. Fixes #9095

Revision 5dea6c81 (diff)
Added by Jim Pingle over 2 years ago

Prevent PHP error when saving log config. Fixes #9095

(cherry picked from commit 4c4e294b0f1523827fa21066521674a435c8f670)

History

#1 Updated by Jim Pingle over 2 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#2 Updated by Steve Wheeler over 2 years ago

  • Status changed from Feedback to Resolved

Tested against:
2.4.5-DEVELOPMENT (amd64)
built on Tue Nov 06 11:45:54 EST 2018

Repeated above steps. Log settings were saved. No errors seen.

Also available in: Atom PDF