Commit 3e016431 authored by Pablo Orduña's avatar Pablo Orduña

Do not disclose the file system full path

For example, when uploading a file called "foo/bar.txt" twice, right now it shows the full directory (e.g., "File /your/system/directory/foo/bar.txt already exists"), instead of only showing "File foo/bar.txt already exists".
parent aced0e83
......@@ -596,7 +596,8 @@ class FileAdmin(BaseView, ActionsMixin):
secure_filename(form.upload.data.filename))
if op.exists(filename):
flash(gettext('File "%(name)s" already exists.', name=filename),
secure_name = op.join(path, secure_filename(form.upload.data.filename))
flash(gettext('File "%(name)s" already exists.', name=secure_name),
'error')
else:
self.save_file(filename, form.upload.data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment