Parcourir la source

Update file.py

There were problems with Image links from Facebook for example, because they have and need ?parameter1=abc&parameter2=def in their address.
version-14
ci2014 il y a 8 ans
committed by GitHub
Parent
révision
341e71ae86
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. +5
    -0
      frappe/core/doctype/file/file.py

+ 5
- 0
frappe/core/doctype/file/file.py Voir le fichier

@@ -329,7 +329,12 @@ def setup_folder_path(filename, new_parent):

def get_extension(filename, extn, content):
mimetype = None

if extn:
# remove '?' char and parameters from extn if present
if '?' in extn:
extn = extn.split('?', 1)[0]

mimetype = mimetypes.guess_type(filename + "." + extn)[0]

if mimetype is None or not mimetype.startswith("image/") and content:


Chargement…
Annuler
Enregistrer