Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

--- develop ---

* bug: Pass a boolean (not the integer 1) to api_plugin_register_hook()'s $enable argument so the hook registration stays type-correct under Cacti 1.3's strict bool type-hint (the int only coerces while the file lacks declare(strict_types=1))
* security: Move the graph 'Add to QuickTree' icon's inline `onClick='addQuickTree()'` handler into a delegated jQuery binding in `js/quicktree.js` (via a `quicktreeAddLink` class and `data-` attributes) and replace the confirmation pages' inline `onClick='cactiReturnTo()'` Cancel buttons with the CSP-safe `cactiReturnTo` class, so the pages no longer trip Cacti's Content-Security-Policy script-src-attr directive
* dev: Replace the translation-template CI check that regenerated locales/po/cacti.pot and compared it with a diff-based gate (tests/bin/check-i18n-pot.php) requiring cacti.pot to be updated only when a pull request adds, removes, or modifies an i18n function call
* dev: Measure CI coverage with xdebug instead of pcov so the plugin's own sources are instrumented (pcov auto-scopes to the Composer root and skipped cacti/plugins/, leaving the patch-coverage gate with nothing to measure)
Expand Down
2 changes: 1 addition & 1 deletion setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ function quicktree_check_upgrade(): void {
['quicktree']);

if ($current != $old) {
api_plugin_register_hook('quicktree', 'page_head', 'quicktree_page_head', 'setup.php', 1);
api_plugin_register_hook('quicktree', 'page_head', 'quicktree_page_head', 'setup.php', true);

quicktree_setup_table();

Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/QuicktreeCheckUpgradeTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
&lt;?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2004-2026 The Cacti Group |
Expand Down Expand Up @@ -79,7 +79,7 @@
quicktree_check_upgrade();

$pageHeadHooks = array_filter($GLOBALS['__test_registered_hooks'], function ($hook) {
return $hook['hook'] === 'page_head' && $hook['enabled'] === 1;
return $hook['hook'] === 'page_head' && $hook['enabled'] === true;
});

expect($pageHeadHooks)->not->toBeEmpty();
Expand Down
Loading