liip/url-auto-converter-bundle
A Symfony bundle that automatically turns plain URLs in text into clickable HTML links. It provides a Twig filter and configurable URL detection, making it easy to render user-generated content with safe, consistent link markup.
Architecture fit — poor as a dependency, moderate as a reference implementation
url_auto_converter filter) wired through Symfony's DI container (XML/YAML service definitions) and depends on symfony/framework-bundle and symfony/twig-bundle. Laravel has no bundle concept; it has service providers, facades, and Blade. There is no shared extension point. Release 1.3.2 does not change this — a patch bump cannot close a framework-shaped gap.rcrowe/twigbridge), which introduces a second templating stack, a second escaping model, and a second maintenance liability — all to obtain a string-filtering function.www. hosts, email addresses) plus the trivial Twig wrapper. That is a small, self-contained unit of logic — on the order of a few hundred lines — and every architectural concern around it (DI, config, templating) is Symfony-specific and must be discarded.Integration feasibility — low without modification, trivial after extraction (unchanged)
symfony/* constraints pinned to the 2.x/3.x era; a single-merge patch release is unlikely to have re-pinned the constraint set, but this must be verified against the published composer.json rather than assumed. --ignore-platform-reqs still produces an uninstallable runtime, not a working feature.app/Support/ (MIT permits this), delete Symfony DI, and re-expose it as a Blade directive, a Str::macro, or an Eloquent cast/accessor. Measured in hours, not days.Technical risk — high relative to the value delivered
<a href="..."> markup. The critical unknowns remain (a) whether the converter escapes input itself or expects pre-escaped input, and (b) whether the consuming template emits the result with |raw. Getting the order wrong turns a convenience filter into a stored-XSS vector. The scheme allowlist must be explicit; a converter that links any xxx:// will happily produce javascript: and data: hrefs.v1.2.3), filenames (report.pdf), UUIDs, IP-like tokens, and broken output when the source text already contains <a> tags or sits inside <code>/<pre>.rel="noopener noreferrer" on target="_blank", no IDN/unicode handling, no configurable truncation for very long URLs. A single contributor PR may have fixed one of these — confirm rather than assume.Key questions to resolve before any code is written
<a> attributes, or only composer/PHP compatibility? This gates everything downstream.{{ }}?linkifyjs, autolinker) sufficient and safer?league/commonmark's autolink extension for Markdown sources, paired with an HTML sanitizer) a better base than this bundle?Stack fit
mews/purifier or tgalopin/html-sanitizer. This bundle does not fit that stack; the logic does, after extraction.App\Support\Autolinker with a single method link(string $text): HtmlString, exposed three ways — a Str::macro('autolink', ...), a Blade directive @autolink($text), and a JSON resource cast for API responses. Config file for allowed schemes (http, https, mailto), target/rel policy, and max-URL display length.league/commonmark with its autolink extension and sanitize the rendered HTML.Migration path
app/Support/Autolinker/ with an attribution note recording the exact release tag (MIT).rel="noopener noreferrer nofollow", an explicit scheme allowlist, htmlspecialchars on all interpolated text and attribute values, and a max-length cap on both input and displayed URL.Str::macro, ship behind a feature flag, and A/B the rendered output against the golden files.league/commonmark + sanitizer rather than extending the 2017 regexes.Compatibility
preg_* behavior changes and implicit nullable deprecations. Verify whether 1.3.2 already relaxed any of this.symfony/* constraints conflict with Laravel's own Symfony 6/7 dependencies. Re-check composer.json at 1.3.2, but assume installation is still unsupported and extraction is the only viable route.Sequencing
Maintenance
Support
Scaling
Failure modes
href values. Mitigate with allowlist + sanitizer pass after linking, and a CSP as defense in depth.<a>, <code>, <pre>, or attribute values; double-escaping producing visible & artifacts.mailto: become harvestable and may conflict with GDPR-driven expectations about publishing contact details; make email linking a separate, configurable toggle, default off where user data is involved.Ramp-up
How can I help you explore Laravel packages today?