Skip to content

fix: normalize nullable notification text - #816

Open
somethingwithproof wants to merge 3 commits into
developfrom
fix/nullable-notification-text
Open

fix: normalize nullable notification text#816
somethingwithproof wants to merge 3 commits into
developfrom
fix/nullable-notification-text

Conversation

@somethingwithproof

@somethingwithproof somethingwithproof commented Aug 18, 2026

Copy link
Copy Markdown
Member

Notification text columns can be NULL, and PHP 8 makes passing NULL into the string functions a deprecation rather than an empty string.

Normalises the values at read time.

Closes #814.

@somethingwithproof somethingwithproof self-assigned this Aug 18, 2026
@somethingwithproof
somethingwithproof marked this pull request as ready for review August 18, 2026 06:06
Copilot AI lite review requested due to automatic review settings August 18, 2026 06:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the thold_str_replace() notification-template helper to safely accept a nullable subject (notification text) without relying on PHP 8.1’s deprecated null-to-string coercion, and adds a regression test plus minimal documentation updates.

Changes:

  • Allow thold_str_replace()’s $subject parameter to be nullable and normalize null to '' before calling str_replace().
  • Add a unit regression that asserts the nullable-subject boundary emits no E_DEPRECATED.
  • Document the nullable template-field behavior in README and add a CHANGELOG entry for issue #814.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
thold_functions.php Makes thold_str_replace() accept ?string $subject and normalizes null to empty string to avoid deprecated coercion.
tests/Unit/TholdStrReplaceTest.php Adds a regression test capturing/forbidding E_DEPRECATED when the subject is null.
README.md Documents that unset notification template fields are treated as empty text.
CHANGELOG.md Records the fix for issue #814.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nullable notification text relies on deprecated coercion

2 participants