Skip to content

fix: use PHP string interpolation in log messages#8

Merged
audunru merged 2 commits intomainfrom
fix/log-variable-substitution
May 3, 2026
Merged

fix: use PHP string interpolation in log messages#8
audunru merged 2 commits intomainfrom
fix/log-variable-substitution

Conversation

@audunru
Copy link
Copy Markdown
Owner

@audunru audunru commented May 3, 2026

Summary

  • Replaces PSR-3 {placeholder} syntax in LogCspViolation and LogReport with PHP double-quoted string interpolation
  • Monolog's LineFormatter does not interpolate PSR-3 placeholders by default, causing messages like CSP violation: {directive} blocked {url} to appear literally in logs
  • Updates tests to assert on the actual interpolated message string

Fixes #3

🤖 Generated with Claude Code

audunru and others added 2 commits May 3, 2026 10:09
In Laravel 13, VerifyCsrfToken is deprecated and PreventRequestForgery
is the new base class (with ValidateCsrfToken extending it). Exclude all
three so the endpoint works regardless of which variant the host app uses.

Closes #2
PSR-3 placeholder syntax ({directive}, {url}) is not interpolated by
Monolog's LineFormatter by default, so placeholders appeared literally
in log output. Replaced with PHP double-quoted string interpolation.

Closes #3

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@audunru audunru merged commit 3ba58d9 into main May 3, 2026
2 checks passed
@audunru audunru deleted the fix/log-variable-substitution branch May 3, 2026 08:12
github-actions Bot pushed a commit that referenced this pull request May 3, 2026
## [1.2.2](v1.2.1...v1.2.2) (2026-05-03)

### Bug Fixes

* use PHP string interpolation in log messages ([#8](#8)) ([3ba58d9](3ba58d9)), closes [#2](#2) [#3](#3)
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.

Variables not substituted

1 participant