Skip to content

Conversation

@omar-azzam00
Copy link

@omar-azzam00 omar-azzam00 commented Sep 11, 2025

We should split the values of both the dictionaries datatypes and icontypes to a list so that a file with an extension like 'if,ic' doesn't get mistakenly recognized as an image file.

This happens due to this code which checks against a str not a list:

@app.template_filter('data_fmt')
def data_fmt(filename):
    t = 'unknown'
    for type, exts in datatypes.items():
        if filename.split('.')[-1] in exts:
            t = type
    return t

@omar-azzam00 omar-azzam00 changed the title files with with weird extentions may get mistakenly get recognized as a wrong file type. files with with weird extentions may get mistakenly recognized as a wrong file type. Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant