From 686106d544ecc3b6ffd4db2b665d3bc879a58d8c Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Mon, 24 Sep 2012 16:22:07 -0400 Subject: ok --- public/js/util.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 public/js/util.js (limited to 'public/js/util.js') diff --git a/public/js/util.js b/public/js/util.js new file mode 100644 index 0000000..e69d002 --- /dev/null +++ b/public/js/util.js @@ -0,0 +1,7 @@ +var LESS_THAN = //g, AMPERSAND = /&/g; +function sanitize (s) { + if (s) { + return s.replace(LESS_THAN, '<').replace(GREATER_THAN, '>').replace(AMPERSAND, '&'); + } + return ""; +} \ No newline at end of file -- cgit v1.2.3-70-g09d2