diff --git a/seahub/api2/views.py b/seahub/api2/views.py index 45fc9ee444..25b4728bc4 100644 --- a/seahub/api2/views.py +++ b/seahub/api2/views.py @@ -1582,7 +1582,7 @@ class StarredFileView(APIView): def delete(self, request, format=None): # remove starred file repo_id = request.GET.get('repo_id', '') - path = request.GET.get('p', '') + path = unquote(request.GET.get('p', '').encode('utf-8')) if not (repo_id and path): return api_error(status.HTTP_400_BAD_REQUEST, 'Repo_id or path is missing.') diff --git a/static/scripts/app/views/starred-file-item.js b/static/scripts/app/views/starred-file-item.js index 0e18bb732f..15f1069009 100644 --- a/static/scripts/app/views/starred-file-item.js +++ b/static/scripts/app/views/starred-file-item.js @@ -37,7 +37,7 @@ define([ path = this.model.get('path'); $.ajax({ - url: Common.getUrl({name: 'starred_files'}) + '?p=' + path + '&repo_id=' + repo_id, + url: Common.getUrl({name: 'starred_files'}) + '?p=' + encodeURIComponent(path) + '&repo_id=' + repo_id, type: 'DELETE', beforeSend: Common.prepareCSRFToken, success: function() {