Permalink
Browse files

Fixed JSON templates to avoid invalid \x character sequences and to a…

…void new Date(), which is not valid JSON.
  • Loading branch information...
1 parent 28277fa commit 5b6f3c62e1e312cf890df7f20be0687ca380bea8 @dvogel committed Jan 23, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 templates/JSON/documents.tpl
  2. +1 −1 templates/JSON/search.tpl
@@ -9,7 +9,7 @@
"fragments" : [{{#FRAGMENT}}[{{FROM}},{{TO}},{{LENGTH}},{{HASH}}]{{#FRAGMENT_separator}},{{/FRAGMENT_separator}}{{/FRAGMENT}}],
{{/FRAGMENTS}}
{{#META}}
- "{{KEY}}": {{#NUMBER}}{{VALUE}}{{/NUMBER}}{{#STRING}}"{{VALUE}}"{{/STRING}}{{#DATE}}new Date({{VALUE}}){{/DATE}}{{#META_separator}},{{/META_separator}}
+ "{{KEY}}": {{#NUMBER}}{{VALUE}}{{/NUMBER}}{{#STRING}}"{{VALUE:json_escape}}"{{/STRING}}{{#DATE}}{{VALUE}}{{/DATE}}{{#META_separator}},{{/META_separator}}
{{/META}}
}{{#DOCUMENT_separator}},{{/DOCUMENT_separator}}
{{/DOCUMENT}}
@@ -3,5 +3,5 @@
{{>DOCUMENTS}}
},
{{#SOURCE}}
- "text" : "{{TEXT}}"
+ "text" : "{{TEXT:json_escape}}"
{{/SOURCE}}

0 comments on commit 5b6f3c6

Please sign in to comment.