You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pre-existing defects found during the 4.9 review #351
Found while reviewing the 4.9 changes. All predate the current cycle.
1. lib/mactrack_3com.php:84 — this UPDATE can never run
db_execute('UPDATE mac_track_interface_graphs SET ifIndex = ?, ifName = ? WHERE device_id = ? AND local_graph_id = ?',
[$key, $ifdesc, $device['device_id'], $$local_graph_id[$i]['local_graph_id']]);
Two faults on one statement. db_execute($sql, $log = true, $db_conn = false) takes no parameter array, so the array lands in $log and the four ? placeholders are never bound. And $local_graph_id is an array (line 81 calls cacti_sizeof() on it), so $$local_graph_id is a variable variable over an array, giving Array to string conversion and Undefined variable $Array on PHP 8.
Traces to 88d8a7d (2020). Should be db_execute_prepared() with $local_graph_id[$i]['local_graph_id'].
2. lib/mactrack_functions.php:2090 — trim(null) deprecation on PHP 8.1
function xform_net_address($ip_address) {
$ip_address = trim($ip_address);
The sibling xform_mac_address() one function down was hardened to trim((string) $mac_address); this one was not. Four call sites pass an unguarded array lookup: lib/mactrack_functions.php:2885, lib/mactrack_extreme.php:238, lib/mactrack_extreme.php:269, lib/mactrack_h3c_3com.php:433. An absent SNMP index emits a deprecation on every scan cycle. Same class as #223.
3. poller_mactrack.php:317-325 — errors_disable() and errors_restore() are no-ops
Both rely on track_errors, removed in PHP 8.0, so they do nothing on any supported version.
4. poller_mactrack.php:372 — case E_STRICT:
E_STRICT is deprecated in PHP 8.4 and emits a notice on that CI leg.
5. setup.php:26 — hook that never fires
api_plugin_register_hook('mactrack', 'top_header_tabs', ...). The hook name is valid but no Cacti release calls api_plugin_hook('top_header_tabs'); core only fires top_graph_header_tabs, which line 27 already registers for the same callback. Harmless, but dead.
6. mactrack_view_graphs.php:42 — globals that do not exist
global ... $host_template_hashes, $graph_template_hashes; are defined nowhere in Cacti core on any branch and assigned nowhere in the plugin.
Correction to my earlier checklist: xform_net_address() now has the string conversion, but E_STRICT is still present in poller_mactrack.php. The track_errors handling and top_header_tabs registration also remain. The 3Com update is fixed; the compatibility items still need a focused follow-up.
Activity
somethingwithproof commentedon Nov 9, 2026
Status on
developat 867ca5b:mactrack_3com.phpupdate no longer uses a variable variable.xform_net_address()callstrim()without a string cast. This is the same function as Compressed IPv6 addresses are corrupted by xform_net_address #355 and Binary IP addresses ending in whitespace bytes are truncated #356, so one PR should fix all three.errors_disable()anderrors_restore()still rely ontrack_errors.E_STRICTis gone frompoller_mactrack.php.setup.phpstill registerstop_header_tabs.fix(mactrack): keep IPv6 text and binary addresses intact in xform_ne…
somethingwithproof commentedon Nov 16, 2026
Correction to my earlier checklist: xform_net_address() now has the string conversion, but E_STRICT is still present in poller_mactrack.php. The track_errors handling and top_header_tabs registration also remain. The 3Com update is fixed; the compatibility items still need a focused follow-up.