fix(options): use |escape() instead of |e() — sandbox only allows 'escape'

The twig sandbox policy (application/config/internal.php sandboxConfig) allows
the filter name 'escape' but not its alias 'e', so the S2 escaping in
options/options.twig threw SecurityNotAllowedFilterError (500) on the admin
theme-options page. |escape() is the same filter/callable; all 16 theme twig
templates now compile under the real sandbox policy (verified locally).
Core-side wish filed: FEATURE_REQUEST_sandbox_allow_e_alias.md (local-only).

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-30 14:08:17 +01:00
commit 3c38b4712b

View file

@ -101,10 +101,10 @@
{% for image in templateConfiguration.imageFileList %} {% for image in templateConfiguration.imageFileList %}
{% if image.group != imgGroup %} {% if image.group != imgGroup %}
{% if imgGroup != '' %}{% set imageOptions = imageOptions ~ '</optgroup>' %}{% endif %} {% if imgGroup != '' %}{% set imageOptions = imageOptions ~ '</optgroup>' %}{% endif %}
{% set imageOptions = imageOptions ~ '<optgroup label="' ~ image.group|e('html_attr') ~ '">' %} {% set imageOptions = imageOptions ~ '<optgroup label="' ~ image.group|escape('html_attr') ~ '">' %}
{% set imgGroup = image.group %} {% set imgGroup = image.group %}
{% endif %} {% endif %}
{% set imageOptions = imageOptions ~ '<option data-lightbox-src="' ~ image.preview|e('html_attr') ~ '" value="' ~ image.filepath|e('html_attr') ~ '">' ~ image.filename|e('html') ~ '</option>' %} {% set imageOptions = imageOptions ~ '<option data-lightbox-src="' ~ image.preview|escape('html_attr') ~ '" value="' ~ image.filepath|escape('html_attr') ~ '">' ~ image.filename|escape('html') ~ '</option>' %}
{% endfor %} {% endfor %}
{% if imgGroup != '' %}{% set imageOptions = imageOptions ~ '</optgroup>' %}{% endif %} {% if imgGroup != '' %}{% set imageOptions = imageOptions ~ '</optgroup>' %}{% endif %}