escapeHTML function

remotes/origin/stable45
Lukas Reschke 2012-10-12 14:01:47 +07:00
parent 33bd9ecd9d
commit 1960067926
1 changed files with 9 additions and 0 deletions

@ -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