﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25484	static template tag outputs invalid HTML if storage class's url() returns a URI with '&' characters.	João Miguel Neves	alix-	"When using a storage class like 'storages.backend.s3.S3BotoStorage' from django-storages/django-storages-redux the following template code:

{{{
<link href=""{% static 'css/styles.css' %}"" rel=""stylesheet"" type=""text/css"" />
}}}

is rendered as:

{{{
<link href=""https://bucket.region.amazonaws.com:443/css/styles.css?Signature=sm8uyGp12rTST59hSWyTtZz8A&Expires=1443476662&AWSAccessKeyId=AN_AWS_KEY"" rel=""stylesheet"" type=""text/css"" />
}}}

when the valid html should be:

{{{
<link href=""https://bucket.region.amazonaws.com:443/css/styles.css?Signature=sm8uyGp12rTST59hSWyTtZz8A&amp;Expires=1443476662&amp;AWSAccessKeyId=AN_AWS_KEY"" rel=""stylesheet"" type=""text/css"" />
}}}

This issue is only visible when using a storage that returns URLs with '&' characters in the query string.

Work-around: You get the correct result if you render the above as:

{{{
{% static 'css/styles.css' as this_url %}
<link href=""{{ this_url }}"" rel=""stylesheet"" type=""text/css"" />
}}}"	Bug	closed	contrib.staticfiles	dev	Normal	fixed		olivier.tabone@…	Accepted	1	0	0	0	0	0
