From b998e634c455fa8a2675ea7dd168bd35bedbe623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 3 Nov 2013 18:41:31 +0100 Subject: [PATCH] Sanitize report file extension issue3446 --- CHANGELOG | 2 ++ tryton/action/main.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 20bf42ac37..fc8f44a4ca 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Sanitize report file extension + Version 3.0.0 - 2013-10-21 * Bug fixes (see mercurial logs for details) * Add factor on number widgets diff --git a/tryton/action/main.py b/tryton/action/main.py index 4913b04b9c..d06afb0052 100644 --- a/tryton/action/main.py +++ b/tryton/action/main.py @@ -42,7 +42,8 @@ class Action(object): dtemp = tempfile.mkdtemp(prefix='tryton_') fp_name = os.path.join(dtemp, name.replace(os.sep, '_').replace(os.altsep or os.sep, '_') - + os.extsep + type) + + os.extsep + + type.replace(os.sep, '_').replace(os.altsep or os.sep, '_')) with open(fp_name, 'wb') as file_d: file_d.write(data) if email_print: