Skip to content

Sync the e() helper override removal into wip/1.3 - #273

Merged
LukeTowers merged 1 commit into
wintercms:wip/1.3from
austinderrick:fix/sync-e-helper-override-removal
Nov 3, 2026
Merged

LukeTowers merged 1 commit into
wintercms:wip/1.3from
austinderrick:fix/sync-e-helper-override-removal

Conversation

@austinderrick

Copy link
Copy Markdown
Contributor

Cherry-picks #267 from develop into wip/1.3.

wintercms/winter#1558 is on the modules' wip/1.3 and depends on #267, but wip/1.3 here still has the e() override. CodeEditor::prepareVars() no longer double-encodes and e() does not either, so a stored &lt;script&gt; loads in the code editor as <script>.

e() has been overridden in Storm since 2020 for a single reason: Laravel 5.6 changed the helper's $doubleEncode default from false to true, aligning it with htmlspecialchars()'s own default, and rather than pass false at the handful of call sites that were double-encoding as a result, the default was reverted globally. That shim has outlived its purpose, and the call sites it was hiding are better fixed directly.

Keeping it has three costs. The body is still Laravel 5.x's, so e() here does not resolve a DeferringDisplayableValue and does not unwrap a BackedEnum — e($someEnum) raises Object of class X could not be converted to string where Laravel returns the backing value, which makes ordinary Laravel-style plugin code fail on Winter for a non-obvious reason. The escaping default matches neither Laravel nor PHP. And it makes the test suite disagree with the application: the composer binary requires vendor/autoload.php before the configured bootstrap, so PHPUnit resolves Laravel's e() while the served application resolves this one, and no test can observe the behaviour being overridden.

Deleting it restores Laravel's implementation in both contexts. bootstrap/autoload.php's priority require stays — it is still load-bearing for trans() and collect().

Behaviour changes
e() now double-encodes by default, matching Laravel and htmlspecialchars(). e('Tom &amp; Jerry') returns Tom &amp;amp; Jerry rather than Tom &amp; Jerry.
e() on a backed enum returns its value instead of raising.
e() resolves a DeferringDisplayableValue.
e(null) is unchanged (empty string).

(cherry picked from commit 7b506f5)
@coderabbitai

coderabbitai Bot commented Nov 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fe022c73-8354-42f5-9c66-e9be91d942a7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@LukeTowers
LukeTowers merged commit 8e46354 into wintercms:wip/1.3 Nov 3, 2026
10 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.

2 participants