Skip to content

Commit

Permalink
Don't fail if cacti_log is passed a string, encode it instead of a fa…
Browse files Browse the repository at this point in the history
…tal error.
  • Loading branch information
TheWitness committed Dec 23, 2024
1 parent efe329c commit 4dfbb15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,9 @@ function cacti_log($string, $output = false, $environ = 'CMDPHP', $level = '') {
$database_log = false;
}

if ($string == '' || trim($string) == '') {
if (is_array($string)) {
$string = json_encode($string);
} elseif ($string == '' || trim($string) == '') {
return false;
}

Expand Down

0 comments on commit 4dfbb15

Please sign in to comment.