summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2012-10-12 14:01:47 +0200
committerLukas Reschke <lukas@statuscode.ch>2012-10-12 14:04:09 +0200
commit1960067926b5928a2023d819bcf504e4c0057e23 (patch)
tree80d2399a76253b59c1acd8435565841f2c72e697 /core/js
parent33bd9ecd9d5196d2209d52a4c96e65fce4edee7e (diff)
downloadnextcloud-server-1960067926b5928a2023d819bcf504e4c0057e23.tar.gz
nextcloud-server-1960067926b5928a2023d819bcf504e4c0057e23.zip
escapeHTML function
Diffstat (limited to 'core/js')
-rw-r--r--core/js/js.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 657dd6d6f8a..9a7da67e71f 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -30,6 +30,15 @@ function t(app,text){
}
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