You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 9, 2018. It is now read-only.
I think CachedFilesMixin has a bug somewhere around lines (storage.py lines 200-213)
url_parts = url.split('/')
parent_level, sub_level = url.count('..'), url.count('/')
if url.startswith('/'):
sub_level -= 1
url_parts = url_parts[1:]
if parent_level or not url.startswith('/'):
start, end = parent_level + 1, parent_level
else:
if sub_level:
if sub_level == 1:
parent_level -= 1
start, end = parent_level, sub_level - 1
else:
start, end = 1, sub_level - 1
joined_result = '/'.join(name_parts[:-start] + url_parts[end:])
In my case I enter this block with: name_parts = [u'css', u'plugins', u'toaster.css'] and url = '/assets/images/icons/fancy_close.png' and expect joined_result in the end be images/icons/fancy_close.png, but instead it is icons/fancy_close.png.
For a url='/assets/images/glyphicons-halflings.png' it seems to work correct.
The text was updated successfully, but these errors were encountered:
I was able to overcome this by monkey-patching and changing to
if parent_level or not url.startswith('/'):
start, end = parent_level + 1, parent_level
else:
if sub_level:
if sub_level == 1:
parent_level -= 1
start, end = parent_level, 1 # <---- USING '1' HERE INSTEAD OF 'sub_level - 1'
else:
start, end = 1, sub_level - 1
It works in my env, though I am not sure if this is correct.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I think CachedFilesMixin has a bug somewhere around lines (storage.py lines 200-213)
In my case I enter this block with:
name_parts = [u'css', u'plugins', u'toaster.css']
andurl = '/assets/images/icons/fancy_close.png'
and expectjoined_result
in the end beimages/icons/fancy_close.png
, but instead it isicons/fancy_close.png
.For a
url='/assets/images/glyphicons-halflings.png'
it seems to work correct.The text was updated successfully, but these errors were encountered: