Skip to content

fix(php): remove dead csvOutput() and deprecated curl_close() - #89

Merged
TheWitness merged 4 commits into
Cacti:developfrom
somethingwithproof:fix/php84-fputcsv-escape
Dec 5, 2026
Merged

TheWitness merged 4 commits into
Cacti:developfrom
somethingwithproof:fix/php84-fputcsv-escape

Conversation

@somethingwithproof

@somethingwithproof somethingwithproof commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Fixes #88

Summary

  • Remove Controller::csvOutput() from controllers/controller.php. It looped over an undefined $test_data, nothing in the plugin calls it, and it is not an action in npc.php's $allowed_modules allowlist, so it could never run. It held the only fputcsv() call, which passed no $escape argument (deprecated in PHP 8.4).
  • Remove the curl_close() call from tests/E2E/support/server.php. It has been a no-op since PHP 8.0 and PHP 8.5 deprecates it.
  • Add a CHANGELOG entry.

Verification

  • tests/Unit/CsvEscapeTest.php asserts the method is gone and the helper no longer calls curl_close(). It failed before the removal and passed after: 2 passed (2 assertions).
  • Full suite in Docker (PHP 8.2, Cacti 1.2.x checkout): 1067 passed, 144 skipped (no test database), 0 failed.
  • Changed-line coverage check: no measured production lines changed.
  • CI: PHP 8.2 to 8.6 integration tests, CodeQL and SonarCloud pass.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
csvOutput() iterated over an undefined $test_data, had no callers and is
not in npc.php's action allowlist, so it could never run. Removing it
drops the only fputcsv() call instead of patching an unreachable line.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof somethingwithproof changed the title fix(php): pass explicit escape parameter to fputcsv() fix(php): remove dead csvOutput() and deprecated curl_close() Dec 5, 2026
@sonarqubecloud

sonarqubecloud Bot commented Dec 5, 2026

Copy link
Copy Markdown

@TheWitness
TheWitness merged commit dd3e002 into Cacti:develop Dec 5, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pass explicit escape parameter to fputcsv() in controllers/controller.php

2 participants