Skip to content

Commit adbf77b

Browse files
committed
Encode html entities
1 parent 2145374 commit adbf77b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

js/utils.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,10 @@ WebAppUtils.validateFields = function(path) {
6969

7070
return rc;
7171
};
72+
73+
WebAppUtils.encodeHtmlEntities = function(s) {
74+
var rc = s.replace(/[\u00A0-\u9999<>\&]/g, function(i) {
75+
return '&#'+i.charCodeAt(0)+';';
76+
});
77+
return rc;
78+
};

0 commit comments

Comments
 (0)