Skip to content

Commit

Permalink
[#1057][xs] escape pjson callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Toby committed Feb 13, 2012
1 parent a608d92 commit 3d7cbf0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ckan/controllers/api.py
@@ -1,4 +1,5 @@
import logging
import cgi

from paste.util.multidict import MultiDict
from webob.multidict import UnicodeMultiDict
Expand Down Expand Up @@ -70,7 +71,8 @@ def _finish(self, status_int, response_data=None,
if status_int==200 and request.params.has_key('callback') and \
(request.method == 'GET' or \
c.logic_function and request.method == 'POST'):
callback = request.params['callback']
# escape callback to remove '<', '&', '>' chars
callback = cgi.escape(request.params['callback'])
response_msg = self._wrap_jsonp(callback, response_msg)
return response_msg

Expand Down

0 comments on commit 3d7cbf0

Please sign in to comment.