summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/server/json2.js3
-rw-r--r--share/www/script/json2.js3
2 files changed, 4 insertions, 2 deletions
diff --git a/share/server/json2.js b/share/server/json2.js
index 39d8f370..a1a3b170 100644
--- a/share/server/json2.js
+++ b/share/server/json2.js
@@ -1,6 +1,6 @@
/*
http://www.JSON.org/json2.js
- 2009-09-29
+ 2010-03-20
Public Domain.
@@ -433,6 +433,7 @@ if (!this.JSON) {
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.
+ text = String(text);
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
diff --git a/share/www/script/json2.js b/share/www/script/json2.js
index 39d8f370..a1a3b170 100644
--- a/share/www/script/json2.js
+++ b/share/www/script/json2.js
@@ -1,6 +1,6 @@
/*
http://www.JSON.org/json2.js
- 2009-09-29
+ 2010-03-20
Public Domain.
@@ -433,6 +433,7 @@ if (!this.JSON) {
// Unicode characters with escape sequences. JavaScript handles many characters
// incorrectly, either silently deleting them, or treating them as line endings.
+ text = String(text);
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {