1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-23 04:18:21 +00:00

[lib] added necessary 'escape'

Conflicts:
	seahub/views/ajax.py
This commit is contained in:
llj
2015-03-19 15:40:40 +08:00
committed by Daniel Pan
parent 5005b78e54
commit 27aa7e79d3
5 changed files with 20 additions and 25 deletions

View File

@@ -695,7 +695,7 @@ def delete_dirent(request, repo_id):
content_type=content_type)
except SearpcError, e:
logger.error(e)
err_msg = _(u'Internal error. Failed to delete %s.') % dirent_name
err_msg = _(u'Internal error. Failed to delete %s.') % escape(dirent_name)
return HttpResponse(json.dumps({'error': err_msg}),
status=500, content_type=content_type)
@@ -841,7 +841,7 @@ def cp_file(src_repo_id, src_path, dst_repo_id, dst_path, obj_name, username):
content_type=content_type)
result['success'] = True
msg = _(u'Successfully copied %(name)s') % {"name":escape(obj_name)}
msg = _(u'Successfully copied %(name)s') % {"name": escape(obj_name)}
result['msg'] = msg
if res.background:
@@ -886,7 +886,7 @@ def mv_dir(src_repo_id, src_path, dst_repo_id, dst_path, obj_name, username):
content_type=content_type)
result['success'] = True
msg = _(u'Successfully moved %(name)s') % {"name":escape(obj_name)}
msg = _(u'Successfully moved %(name)s') % {"name": escape(obj_name)}
result['msg'] = msg
if res.background:
result['task_id'] = res.task_id
@@ -929,7 +929,7 @@ def cp_dir(src_repo_id, src_path, dst_repo_id, dst_path, obj_name, username):
content_type=content_type)
result['success'] = True
msg = _(u'Successfully copied %(name)s') % {"name":escape(obj_name)}
msg = _(u'Successfully copied %(name)s') % {"name": escape(obj_name)}
result['msg'] = msg
if res.background:
result['task_id'] = res.task_id