Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Sulu Email Obfuscator Bundle Laravel Package

kreativsoehne/sulu-email-obfuscator-bundle

A Sulu CMS bundle for obfuscating email addresses in templates and content, helping protect them from spam bots while keeping mailto links usable for visitors. Lightweight integration for Sulu/Twig projects.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. Despite being catalogued here as a Laravel/PHP package, the release notes describe a Sulu CMS bundle (Symfony bundle + Twig extension + response post-processor), not a Laravel package. There is no service provider, no config publish tag, and no middleware in the Laravel sense. If the target stack is Laravel, architectural fit is poor out of the box; if the target stack is Sulu/Symfony, fit is good — it uses the conventional "rewrite the finished response" pattern, which is the correct layer for email obfuscation because it is template-agnostic and works for content authored by editors in the CMS.

Integration feasibility. High for Sulu: activation is bundle registration, with no template edits required. Two escape hatches exist for cases where the template wants control: the sulu_obfuscate_email / sulu_obfuscate_emails Twig filters. The data-obfuscated-email marker on rewritten links is a sound design decision — it separates "browser knows what to un-rotate" from "rewriter knows what it has already seen", which is the usual source of double-processing bugs. Preview bypass via the request's preview attribute is pragmatic but Sulu-specific; anything outside Sulu's preview flow (draft shares, staging domains, AJAX preview) will not be detected.

Technical risk. Mostly concentrated in the HTML string rewriting:

  • Rewriting serialized HTML is inherently fragile. Any regex- or tokenizer-based pass risks corrupting markup in edge cases (nested attributes, CDATA, HTML comments containing mailto:, emails injected by JavaScript at runtime).
  • The exclusion list (comments, script, style, textarea, title, non-mailto link content) is the right starting set, but it also means emails in JSON-LD, meta tags, data-* attributes, and img alt text are untouched — a partial-coverage story that must be documented, not discovered.
  • De-obfuscation client-side is not described. The marker attribute implies a JS counterpart, but the release notes do not say whether that script ships with the package, how it is loaded, or whether it uses eval/inline script. This is the single largest unknown for a TPM: it determines CSP posture and whether the feature silently fails in hardened environments.
  • Accessibility and UX regressions are not addressed: screen-reader output, right-click "copy email", and noscript behavior.
  • v1.0.0 labeled "Erste Fassung" with German-only notes implies no upgrade history, no deprecation policy, and no demonstrated semver discipline.

Key questions.

  1. What is the actual transformation (ROT13, reversal, base64) and is the inverse implemented client-side, server-side, or both?
  2. Does the package ship the de-obfuscation JS, and is it CSP-safe (no inline script, no eval)?
  3. Is there a configuration surface for bypass (admin routes, AJAX, staging domains, Vary/cache headers) beyond the preview attribute?
  4. Does the response listener skip non-HTML content types, streamed responses, and binary payloads?
  5. What is the license, maintainer count, test coverage, and supported Sulu/Symfony/PHP matrix?
  6. What happens to already-obfuscated HTML passing through a second time (nested bundles, ESI, sub-requests)?

Integration Approach

Stack fit. Only adopt directly if we run Sulu 2.x on Symfony with Twig 3. For a Laravel estate, this is at best a reference implementation: the rewriter core is reusable, but the delivery mechanism (Symfony response listener, Twig extension) must be replaced with Laravel middleware and a Blade directive/helper.

Migration path. Greenfield — there is no incumbent implementation to migrate from, which is an advantage. Two viable paths:

  1. Direct adoption (Sulu): install the bundle, register it, verify no template changes are needed, then audit which of our templates rely on the opt-out filters.
  2. Adapter adoption (Laravel): fork or vendor the rewriting logic behind Illuminate\Http\Middleware, expose @obfuscateEmail / @obfuscateEmails Blade directives as equivalents of the Twig filters, and reimplement the preview bypass against our own draft/preview mechanism rather than Sulu's request attribute.

Compatibility. Verify supported PHP/Symfony/Twig versions before committing. Confirm whether the client-side component (if any) conflicts with our CSP, our tag manager, or our existing mailto handlers. Confirm behavior under response caching and CDN: obfuscated HTML is safe to cache, but any preview bypass must set Vary/Cache-Control: private correctly, otherwise draft content leaks to anonymous visitors — a security-relevant failure mode, not a cosmetic one.

Sequencing.

  1. Spike in a staging Sulu instance; run the rewriter against a corpus of real pages (contact pages, team listings, legal/imprint pages, footers, JSON-LD-heavy pages).
  2. Add the de-obfuscation script under our CSP and confirm click-to-mail works in all target browsers and with JS disabled.
  3. Regression-test templates, cache layers, and preview workflows.
  4. Decide: direct bundle adoption, or extract the rewriting logic into an internal Laravel package with our own tests.
  5. Only then evaluate production rollout; treat the upstream package as a starting point, not a dependency we can rely on for fixes.

Operational Impact

Maintenance. Highest operational concern. v1.0.0, single "first draft" release, German-only documentation, and an implied small maintainer base. We should assume we will own this code. Budget for a vendored fork with our own regression suite over real page fixtures, or accept the risk explicitly and timebox it.

Support. No upstream SLA. Internal ownership must be assigned before rollout, ideally to the team that owns the CMS frontend. Document the exclusion list and the bypass mechanism, because the first support ticket will be "why is this email address still visible?" or "why did the contact link stop working?"

Scaling. The pass is O(n) over each HTML response with a full body copy in memory. For typical CMS pages this is negligible; for large listing pages, PDF/binary responses, or streamed responses it matters, and the listener must explicitly skip them. CDN and reverse-proxy behavior needs care: correct Vary and cache-key treatment for the preview bypass is mandatory. Also account for double-processing via ESI, sub-requests, or nested bundles — the data-obfuscated-email marker mitigates this, but only if the rewriter genuinely checks it.

Failure modes.

  • Silent breakage: malformed HTML from the rewriter producing broken markup on a subset of pages.
  • Dead links: CSP blocking, JS failing to load, or the de-obfuscation script not being registered — links look correct but do nothing.
  • Coverage gaps: emails in JSON-LD, meta tags, data-*, image alt text remain scrapable; marketing may believe they are protected.
  • Preview leakage: preview bypass not honored on a non-Sulu preview path, or preview responses cached publicly.
  • Partial obfuscation: regex misses obfuscating an address, giving false confidence.
  • Accessibility/UX regression: copy-paste and screen-reader behavior degrade without anyone noticing.

Ramp-up. Low for a Sulu/Twig team — it is essentially install-and-go, with the opt-out filters as the only thing to learn. Medium for a Laravel team: the concepts transfer, but the implementation must be ported and re-tested, and German-language docs plus a missing JS/distribution story add friction. Recommend one engineer own the spike end-to-end and produce an internal README covering the transformation scheme, the exclusion list, the bypass rules, and the client-side contract before any wider rollout.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log