Commit 24e9977a authored by Mikaël Salson's avatar Mikaël Salson
Browse files

controllers/ Deal with empty extension

When ext_len == 0, filename[-0:] returns the whole filename which would not
match the empty string.

Thanks to @magiraud for spotting this.
Follows 739e82eb.
parent 739e82eb
......@@ -646,7 +646,7 @@ def restart_pre_process():
def match_filetype(filename, extension):
ext_len = len(extension)
return filename[-ext_len:] == extension
return ext_len == 0 || filename[-ext_len:] == extension
def filesystem():
json = []
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment