* fix: Fix php deprecation of spl_object_hash in php 8.6
Replaces spl_object_hash() calls to address the PHP 8.6 deprecation.
Adds cacti_object_hash(), which uses spl_object_id() to produce a stable 32 character hash string, and migrates the database connection and affected-row tracking in lib/database.php to the helper. Boost already keys its per-connection packet-limit cache on spl_object_id() on develop, so no change is needed there.
Adds tests/Unit/CactiObjectHashTest.php covering hash format, determinism, uniqueness, and the non-object false return.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* tests: Cover cacti_object_hash connection-tracking paths in database.php
The changed-PHP-lines coverage gate fell below 80 percent because the cacti_object_hash() swaps in db_check_reconnect(), db_close(), and db_execute_prepared() (the DEBUG_SQL_CONNECT branches) were not exercised. Adds a unit test that drives those paths with a real PDO handle registered in \, raising changed-line coverage of lib/database.php to 7 of 8 lines (overall 10 of 11, 90.9 percent).
Every connection global these functions assign to is snapshotted and restored around each test so the shared connection state the rest of the suite relies on is not corrupted.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* tests: Move CactiObjectHashTest into the Core category folder
AGENTS.md requires unit tests to live in a category subfolder rather than the tests/Unit/ root. Moves the cacti_object_hash() helper test to tests/Unit/Core/ alongside the other core utility tests and updates its lib/functions.php include to dirname(__DIR__, 3) so it still resolves to the repository root.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: TheWitness <copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* deps(deps): bump chart.js from 2.9.4 to 4.6.1
Bumps [chart.js](https://github.com/chartjs/Chart.js) from 2.9.4 to 4.6.1.
- [Release notes](https://github.com/chartjs/Chart.js/releases)
- [Commits](https://github.com/chartjs/Chart.js/compare/v2.9.4...v4.6.1)
---
updated-dependencies:
- dependency-name: chart.js
dependency-version: 4.6.1
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com>
* fix(build): sync chart.js 4.x UMD bundle
chart.js 4.x no longer ships dist/Chart.js; its browser bundle is now dist/chart.umd.js, which auto-registers all controllers and exposes the global Chart like the 2.x build. Point sync-js at the new path and refresh the vendored include/js/Chart.js so postinstall and the JavaScript contract tests succeed.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: TheWitness <copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The XSS rule only modelled request variables, so stored text such as device
descriptions, graph titles, notes, SNMP strings and plugin hook output was
never reported. form_selectable_cell() prints its contents verbatim and had no
rule at all.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Single-quoted PHP gettext in <script> breaks when the French
translation contains an apostrophe. Use json_encode() as support.php
already does so the apostrophe is string data.
Fixes#8555
Co-authored-by: Maël Chouteau <mael.chouteau@pmbservices.fr>
* refactor(themes): remove the Carrot and Hollyberry themes
Both were near-copies of the classic stylesheet kept as examples; the 1.3.0 upgrade prunes their directories and moves anyone who selected them to Modern instead of the alphabetical fallback.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* docs(changelog): add fragment for #8526
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* test: cover retired theme cleanup and handle deleted coverage files
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
---------
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix(a11y): [develop] correct labels, document semantics and duplicate IDs
Associates form controls with their labels, replaces obsolete tt markup, removes duplicate element IDs, and adds a native accessibility browser suite with its database fixture.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix(a11y): validate label IDs and recognize attribute escaping
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
---------
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Commit 8471 bumped dompurify from 3.4.16 to 3.4.17 in package.json but left
the JavaScript contract test and the vendored include/js/purify.js at 3.4.16,
breaking the "JavaScript contracts" CI job on develop (test "DOMPurify is
pinned and generated from the matching npm release").
- Update tests/js/sync_js.test.mjs to expect dompurify 3.4.17 in both the
package.json pin assertion and the purify.js license-header match.
- Regenerate include/js/purify.js and include/js/purify.js.map from the
dompurify 3.4.17 npm release via build/sync-js.mjs (npm install postinstall).
All 78 JavaScript contract tests pass locally.
Co-authored-by: TheWitness <copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* hardening(import): require a 2048-bit RSA key for Package signatures
Apply the 1.2.x key floor from #7194 to every Package verify and every key
develop trusts or stores, and stop trusting the legacy 512-bit Cacti key.
Refs #8460
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* docs(changelog): add fragment for #8464
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
---------
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* ci(security): treat grv() and gnrv() as Semgrep request sources
The gating XSS rule missed the short request helpers, the header() rule trusted HTML escapers that do not stop an off-site redirect, and the advisory taint rules missed get_request_var().
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* ci(security): gate Semgrep on new findings for every event
The new sources also match values an earlier gfrv() validated, so a whole-tree result cannot gate pushes; a single job keeps results stable run to run.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
---------
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix(packaging): name archives from supplied metadata
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix(packaging): make archive leaf-name confinement explicit
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* test(e2e): move the pointer off the Deepness multiselect button
Deepness sets a zero body margin, so the unhovered #ms-button sits at the viewport origin and headless Chromium on Linux intermittently applies :hover to it.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* ci: pull pinned integration database from authenticated mirror
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
---------
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix(rrd): [develop] retain source identity after CF fallback
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* test: measure native consolidation fallback coverage
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
---------
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Deepness sets a zero body margin, so the unhovered #ms-button sits at the viewport origin and headless Chromium on Linux intermittently applies :hover to it.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix(docker): restrict the dev stack to localhost and make the poller run
The web port bound to every interface, named volumes hid the shipped .htaccess denies, and the cron job could neither find php nor write to PID 1's output, so the poller never ran.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* test(docker): keep harnesses polling and restore the developer's config.php
check_docker.sh deleted an existing include/config.php on exit, health polling aborted under pipefail before the container reported, the MariaDB wait had no bound, and the BSD mktemp template left its Xs literal.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* docs(changelog): add fragment for #8453
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* test(e2e): move the pointer off the Deepness multiselect button
Deepness sets a zero body margin, so the unhovered #ms-button sits at the viewport origin and headless Chromium on Linux intermittently applies :hover to it.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* ci: pull pinned integration database from authenticated mirror
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
---------
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix(hooks): check staged blobs and fail closed in the changelog tools
The pre-commit hooks read working-tree files while claiming to check staged content, check-changelog.py passed when its base diff failed, and fold-changelog.py deleted fragments it had not validated.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix(tests): make CI helper scripts fail when they check nothing
check_all_pages.sh passed without logging in or crawling, the sink inventory accepted ripgrep errors, install_packages.sh and copyright_year.sh lost their failures, and the LDAP spec asserted before navigation finished.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix(i18n): audit only changed .po entries and keep contributor badges separate
audit_po.py failed every translation PR on pre-existing errors and matched non-printf text as conversions; update-contributors.py leaked badges between aliased contributors.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* docs(changelog): add fragment for #8457
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* test(e2e): move the pointer off the Deepness multiselect button
Deepness sets a zero body margin, so the unhovered #ms-button sits at the viewport origin and headless Chromium on Linux intermittently applies :hover to it.
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* ci: pull pinned integration database from authenticated mirror
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
---------
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix(themes): skin jQuery multiselect in Deepness and the 3.x markup in four themes
Deepness: main.css repainted select2 onto its --dp-* palette but never
the jQuery multiselect button or popup menu, so those fell through to the
jquery-ui.css textured surfaces and the generic uppercase button rule and
looked like the Dark theme. Repaint them to match the select2 controls.
Cacti, Carrot, Hollyberry, Raspberry: these themes ship the old 1.x
jquery.multiselect.css while include/js/jquery.multiselect.js is 3.x, so
optgroup menus showed list bullets, a nested indent, compounded 0.9em
option text and an unstyled group label. Add the missing 3.x rules.
All changes extend each theme's main.css; the stock
jquery.multiselect.css files are left untouched.
Reported in Cacti/plugin_flowview#298.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(themes): satisfy the develop CHANGELOG and theme coverage gates
- Move the CHANGELOG entries into changelog.d/8443.issue, as develop
expects fragments rather than direct CHANGELOG edits.
- Drop the Deepness multiselect border-radius; .ui-corner-all forces
border-radius with !important in this theme, so it never applied.
- Add Chromium computed-style tests for the new multiselect rules in
Deepness, Cacti, Carrot, Hollyberry and Raspberry so the changed CSS
lines are exercised by the theme correctness suite.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: TheWitness <copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(forms): preserve action URLs in HTML and JavaScript
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* docs(changelog): record form action URL fix for issue 8438
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
* fix(forms): encode configured form name and enctype attributes
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
---------
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Co-authored-by: TheWitness <thewitness@cacti.net>
* fix: Update the deepness favicon
(cherry picked from commit 3a59295162)
* QA: If the SVG is present, it's all we need.
(cherry picked from commit ee0b4c84ed)
* fix: Update such that the modern svg favicon can render