mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-19 05:58:34 +02:00
fix: ticket #75, we are now using an absolute path when saving images to filesystem.
This commit is contained in:
@@ -198,13 +198,15 @@ class Email(object):
|
||||
getattr(self, "viewmail_%s" % mode)(contents[mode], links=links)
|
||||
|
||||
def __save_image(self, fname, part):
|
||||
from django.conf import settings
|
||||
|
||||
if re.search("\.\.", fname):
|
||||
return None
|
||||
path = "static/tmp/" + fname
|
||||
fp = open(path, "wb")
|
||||
path = "/static/tmp/" + fname
|
||||
fp = open(settings.MAILNG_DIR + path, "wb")
|
||||
fp.write(part.get_payload(decode=True))
|
||||
fp.close()
|
||||
return "/" + path
|
||||
return path
|
||||
|
||||
def map_cid(self, url):
|
||||
import re
|
||||
|
||||
Reference in New Issue
Block a user