tree list: encode html entities

This commit is contained in:
rlx 2013-08-07 10:27:10 +00:00
parent 0d40620a68
commit 4b0b11e3d4

View file

@ -186,7 +186,7 @@ Ox.TreeList = function(options, self) {
function parseData(key, value) {
var ret = {
id: Ox.uid().toString(),
title: key.toString() + ': '
title: Ox.encodeHTMLEntities(key.toString()) + ': '
},
type = Ox.typeOf(value);
if (type == 'array' || type == 'object') {
@ -202,8 +202,8 @@ Ox.TreeList = function(options, self) {
ret.title += (
type == 'function'
? value.toString().split('{')[0]
: JSON.stringify(value)
.replace(/(^"|"$)/g, '<span class="OxLight">"</span>')
: Ox.encodeHTMLEntities(JSON.stringify(value))
.replace(/(^&quot;|&quot;$)/g, '<span class="OxLight">"</span>')
);
}
return ret;