]> source.dussan.org Git - nextcloud-server.git/commitdiff
escapeHTML function
authorLukas Reschke <lukas@statuscode.ch>
Fri, 12 Oct 2012 12:01:47 +0000 (14:01 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Fri, 12 Oct 2012 12:10:11 +0000 (14:10 +0200)
core/js/js.js

index d87047dbc6b40b24131af839a7bb6a8fa8d27fcb..ba8020c89edf9b98f2bf839cc08cd4520a167f21 100644 (file)
@@ -46,6 +46,15 @@ function t(app,text, vars){
 }
 t.cache={};
 
+/*
+* Sanitizes a HTML string
+* @param string
+* @return Sanitized string
+*/
+function escapeHTML(s) {
+               return s.toString().split('&').join('&amp;').split('<').join('&lt;').split('"').join('&quot;');
+}
+
 /**
 * Get the path to download a file
 * @param file The filename