提交 20a1f68c 编写于 作者: A AUTOMATIC

fix gadio issue with sending files between tabs

上级 d3463bc5
...@@ -91,6 +91,14 @@ def plaintext_to_html(text): ...@@ -91,6 +91,14 @@ def plaintext_to_html(text):
def image_from_url_text(filedata): def image_from_url_text(filedata):
if type(filedata) == dict and filedata["is_file"]:
filename = filedata["name"]
tempdir = os.path.normpath(tempfile.gettempdir())
normfn = os.path.normpath(filename)
assert normfn.startswith(tempdir), 'trying to open image file not in temporary directory'
return Image.open(filename)
if type(filedata) == list: if type(filedata) == list:
if len(filedata) == 0: if len(filedata) == 0:
return None return None
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册