Escaping Issue in Head Section: Special Characters Converted (e.g., & to &)

Created on 27 March 2025, 10 days ago

Problem/Motivation

When adding scripts to the head section using the Advanced Script Manager module, special characters such as & are being automatically converted to their HTML entity equivalents (&). This results in scripts breaking, especially in cases where URLs contain query parameters or when JavaScript variables rely on unescaped characters.
For example, if a script contains:

<script src="https://example.com/api?param1=value&param2=value"></script>

It is being rendered as:

<script src="https://example.com/api?param1=value&amp;param2=value"></script>

Steps to reproduce

  1. Navigate to the Advanced Script Manager settings page.
  2. Add a script in the header section that includes an & character.
  3. Save the configuration and check the page source.
  4. Notice that & gets converted to &.
๐Ÿ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024