diff options
author | Jef van Schendel <jefvanschendel@gmail.com> | 2011-06-07 15:39:19 +0200 |
---|---|---|
committer | Jef van Schendel <jefvanschendel@gmail.com> | 2011-06-07 15:39:19 +0200 |
commit | 852c7fdb8a8966fac1fff52501a2d65b8354e070 (patch) | |
tree | 61b31fa23275f04a343245668876ef2bd4d9a50e | |
parent | 9c50d0c6989b03979ee97f2b39de4a18937b73e6 (diff) | |
parent | eb21f9a6cb24adeeea10e26442f92a968a38c53e (diff) | |
download | mediagoblin-852c7fdb8a8966fac1fff52501a2d65b8354e070.tar.lz mediagoblin-852c7fdb8a8966fac1fff52501a2d65b8354e070.tar.xz mediagoblin-852c7fdb8a8966fac1fff52501a2d65b8354e070.zip |
Merge remote-tracking branch 'gitorious/master'
-rw-r--r-- | mediagoblin/submit/security.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/mediagoblin/submit/security.py b/mediagoblin/submit/security.py index 5a06a499..b2cb6d88 100644 --- a/mediagoblin/submit/security.py +++ b/mediagoblin/submit/security.py @@ -16,19 +16,11 @@ from mimetypes import guess_type -from Image import open as image_open ALLOWED = ['image/jpeg', 'image/png', 'image/tiff', 'image/gif'] def check_filetype(posted_file): - if not guess_type(posted_file.filename) in ALLOWED: - return False - - # TODO: This should be handled by the processing stage. We should - # handle error detection there. - try: - image = image_open(posted_file.file) - except IOError: + if not guess_type(posted_file.filename)[0] in ALLOWED: return False return True |