Skip to content

Default value for 'Mail Method' (settings_how) is incorrect resulting in errors #2431

@netniV

Description

@netniV

Describe the bug
If the setting 'setting_how' is missing from the settings table, the include/global_settings.php's default value for this is 'PHP Mail() Function' yet uses the $mail_methods in a drop_array style. As such, this is an invalid index against the array and causes issues when later trying to display what method is being used.

To Reproduce
Steps to reproduce the behavior:

  1. Go to MySQL
  2. Execute `DELETE FROM settings WHERE name = 'settings_how'
  3. Try displaying $mail_methods[read_config_option('settings_how')]
  4. See error in cacti.log

Expected behavior
read_config_option('settings_how') should be returning an index number instead of a name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions