django1/django/contrib/staticfiles
Aymeric Augustin 7f6fbc906a Prevented static file corruption when URL fragment contains '..'.
When running collectstatic with a hashing static file storage backend,
URLs referencing other files were normalized with posixpath.normpath.
This could corrupt URLs: for example 'a.css#b/../c' became just 'c'.

Normalization seems to be an artifact of the historical implementation.
It contained a home-grown implementation of posixpath.join which relied
on counting occurrences of .. and /, so multiple / had to be collapsed.

The new implementation introduced in the previous commit doesn't suffer
from this issue. So it seems safe to remove the normalization.

There was a test for this normalization behavior but I don't think it's
a good test. Django shouldn't modify CSS that way. If a developer has
rendundant /s, it's mostly an aesthetic issue and it isn't Django's job
to fix it. Conversely, if the user wants a series of /s, perhaps in the
URL fragment, Django shouldn't destroy it.

Refs #26249.
2016-02-23 19:35:16 +01:00
..
management Used call_command return value in staticfiles tests 2016-02-23 09:12:12 +01:00
templatetags Fixed #21221 -- Made form Media and static template tag use staticfiles if installed. 2015-12-10 14:30:19 -05:00
__init__.py Fixed #21829 -- Added default AppConfigs. 2014-01-25 10:41:56 +01:00
apps.py Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
finders.py Removed unnecessary arguments in .get method calls 2015-05-13 20:51:18 +02:00
handlers.py Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
storage.py Prevented static file corruption when URL fragment contains '..'. 2016-02-23 19:35:16 +01:00
testing.py Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
urls.py Fixed #23276 -- Deprecated passing views as strings to url(). 2014-08-12 13:15:40 -04:00
utils.py Fixed #25331 -- Removed trailing blank lines in docstrings. 2015-08-31 17:37:21 -04:00
views.py Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00