Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
07202744
Commit
07202744
authored
Apr 26, 2017
by
Sébastiaan Versteeg
Browse files
Merge branch '390-404-in-foto-s-otf' into 'master'
Unquote thumbnail URL Closes
#390
See merge request
!450
parents
a9ddc595
47c1136b
Changes
2
Hide whitespace changes
Inline
Side-by-side
website/photos/admin.py
View file @
07202744
...
...
@@ -14,7 +14,8 @@ from .models import Album, Photo
def
validate_uploaded_archive
(
uploaded_file
):
types
=
[
'application/gzip'
,
'application/zip'
]
types
=
[
'application/gzip'
,
'application/zip'
,
'application/x-gzip'
]
if
magic
.
from_buffer
(
uploaded_file
.
read
(),
mime
=
True
)
not
in
types
:
raise
ValidationError
(
"Only zip and tar files are allowed."
)
...
...
website/utils/views.py
View file @
07202744
...
...
@@ -19,6 +19,7 @@ def _private_thumbnails_unauthed(request, size_fit, original_path):
to the authentication requirements for thumbnails, e.g. when sharing
photo albums with external parties using access tokens.
"""
original_path
=
urlunquote
(
original_path
)
thumbpath
=
os
.
path
.
join
(
settings
.
MEDIA_ROOT
,
'thumbnails'
,
size_fit
)
path
=
os
.
path
.
normpath
(
os
.
path
.
join
(
thumbpath
,
original_path
))
if
not
os
.
path
.
commonpath
([
thumbpath
,
path
])
==
thumbpath
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment