commit:94a065048d8029cb407f61443761ad18fad6fa02
author:Chip Black
committer:Chip Black
date:Sun Mar 23 03:46:31 2014 -0500
parents:1552dfc051b6bffa7bb841d5e21caf3dca598ff9
Escape code mode
diff --git a/www/jssrc/blerg/Util.js b/www/jssrc/blerg/Util.js
line changes: +4/-0
index 8706f81..6e99f46
--- a/www/jssrc/blerg/Util.js
+++ b/www/jssrc/blerg/Util.js
@@ -77,6 +77,8 @@ blerg.Util.blergFormat = function(text) {
                 out.push('<p>');
                 githubCodeMode = false;
             } else {
+                // Sanitize HTML input
+                l = l.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
                 out.push(l + "\n");
             }
             return;
@@ -94,6 +96,8 @@ blerg.Util.blergFormat = function(text) {
                 out.push('<pre>');
                 codeMode = true;
             }
+            // Sanitize HTML input
+            l = l.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
             out.push(l.substr(4) + "\n");
             return;
         } else {