plugin_mikrotik
plugin_mikrotik copied to clipboard
ERROR PHP DEPRECATED in Plugin 'mikrotik': str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in file: /var/www/cacti-1.2.21/plugins/mikrotik/poller_graphs.php on line: 386
another deprecated warning, potential fix
if (!$exists) {
$command = "$php_bin -q $base/cli/add_graphs.php" .
" --graph-template-id=$graph_template_id --graph-type=ds" .
" --snmp-query-type-id=$query_type_id --host-id=" . $host_id .
" --snmp-query-id=$query_id --snmp-field=$field" .
" --snmp-value=" . cacti_escapeshellarg($field_value);
$output = $output ? str_replace("\n", " ", passthru($command)): "";
print "NOTE: Adding item: '$field_value' " . $output . "\n";
}
I'm really sorry for not sending a proper pull request, again this is for php 8.1.2