From a1815026156cadb82842a7910e9af30de74a3a50 Mon Sep 17 00:00:00 2001 From: llj Date: Fri, 21 Nov 2014 16:05:23 +0800 Subject: [PATCH] [file_view] file share: bug fix --- seahub/templates/view_file_base.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/seahub/templates/view_file_base.html b/seahub/templates/view_file_base.html index fb6c583bca..145f562479 100644 --- a/seahub/templates/view_file_base.html +++ b/seahub/templates/view_file_base.html @@ -196,9 +196,12 @@ $('#download').click(function() { // share link {% include "snippets/shared_link_js.html" %} $('#share').click(function() { - var op = $(this), name = '{{ filename }}', - aj_urls = { 'link': '{% url 'get_shared_link' %}?repo_id={{ repo.id }}&p={{path|urlencode}}' }, - type = 'f', cur_path = '{{path}}'.substr(0, '{{path}}'.length - name.length); + var op = $(this), + name = "{{filename|escapejs}}", + path = "{{path|escapejs}}"; + aj_urls = { 'link': '{% url 'get_shared_link' %}?repo_id={{ repo.id }}&p=' + e(path) }, + type = 'f', + cur_path = path.substr(0, path.length - name.length); showSharePopup(op, name, aj_urls, type, cur_path); return false; });