Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Scripting Sightly Engine 1.0.2, Scripting Sightly Engine 1.0.18
-
None
Description
When I try to manipulate a href tag with HTL, and the href contains a query param with encoded percentage sign (%25), the HTL manipulator breaks the URI encoding, resulting in a invalid URI.
For example when we have a path property in the repository, containing the following value:
/example/search?q=6%25-10%25
and use the following HTL code:
<a href="${properties.path @ extension = 'html'}">Test with @ HTL URI manipulator</a> <a href="${properties.path}">Test without @ HTL URI manipulator</a>
The result will be:
<a href="/example/search.html?q=6%-10%">Test with @ HTL URI manipulator</a> <a href="/example/search?q=6%25-10%25">Test without @ HTL URI manipulator</a>
So the HTL URI manipulation removes the %25 encoding and replaces it with a single percentage sign. Without manipulation the encoding is preserved. Same holds for other HTL uri manipulators like @ prependPath
Other signs like %3A aren't affected.