escapeHTML function

This commit is contained in:
Lukas Reschke 2012-10-12 14:01:47 +02:00
parent e5f2d46c6f
commit cdd30216b1

View 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