Cacti / plugin_mikrotik

Mikrotik Plugin for Cacti
GNU General Public License v2.0
60 stars 24 forks source link

ERROR PHP DEPRECATED in Plugin 'mikrotik': str_replace() in poller_graphs.php on line: 386 #63

Closed loloski closed 1 year ago

loloski commented 2 years ago

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

TheWitness commented 1 year ago

Okay, this is fixed in develop now.