#25484: static template tag outputs invalid HTML if storage class's url()
returns a
URI with '&' characters.
-------------------------------+--------------------
Reporter: jneves | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
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&Expires=1443476662&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" />
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25484>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.86a67658aeaa22514abc3739e60e7dd6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.