Ver código fonte

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 8 anos atrás
committed by GitHub
pai
commit
341e71ae86
1 arquivos alterados com 5 adições e 0 exclusões
  1. +5
    -0
      frappe/core/doctype/file/file.py

+ 5
- 0
frappe/core/doctype/file/file.py Ver arquivo

@@ -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:


Carregando…
Cancelar
Salvar