Skip to content

Commit

Permalink
Escape settings json using escapejs.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpeterson committed Sep 30, 2013
1 parent 8d814cb commit 9474d9a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
# django-settingsjs changelog.

## v0.1.4

Use `escapejs` to escape JSON rather than assuming it is `safe`.

## v0.1.3

Expand Down
2 changes: 1 addition & 1 deletion settingsjs/__init__.py
@@ -1,4 +1,4 @@
__version__ = (0, 1, 3)
__version__ = (0, 1, 4)


def get_version():
Expand Down
2 changes: 1 addition & 1 deletion settingsjs/templates/settingsjs/settings.js
@@ -1,5 +1,5 @@
(function (window) {
var settings = {{ jssettings|safe }};
var settings = JSON.parse('{{ jssettings|escapejs }}');
S = function () { }
S.get = function (key) { return settings[key]; }
S.set = function (key, val) { return settings[key] = val; }
Expand Down

0 comments on commit 9474d9a

Please sign in to comment.