mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-05-02 14:36:08 -04:00
cleanup revert
This commit is contained in:
parent
0d08edbe55
commit
7b87dc3ca9
3 changed files with 5 additions and 26 deletions
|
@ -415,7 +415,7 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
/**
|
||||
* convert all applicable characters to HTML entities
|
||||
*
|
||||
* @see {@link https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content}
|
||||
* @see {@link https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html}
|
||||
* @name Helper.htmlEntities
|
||||
* @function
|
||||
* @param {string} str
|
||||
|
@ -425,7 +425,8 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
return String(str).replace(
|
||||
/[&<>"'`=\/]/g, function(s) {
|
||||
return entityMap[s];
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -478,28 +479,6 @@ jQuery.PrivateBin = (function($, RawDeflate) {
|
|||
return expirationDate;
|
||||
};
|
||||
|
||||
/**
|
||||
* encode all applicable characters to HTML entities
|
||||
*
|
||||
* @see {@link https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html}
|
||||
*
|
||||
* @name Helper.htmlEntities
|
||||
* @function
|
||||
* @param string str
|
||||
* @return string escaped HTML
|
||||
*/
|
||||
me.htmlEntities = function(str) {
|
||||
return str.replace(
|
||||
/["'\/]/g,
|
||||
function(s) {
|
||||
return {
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
'/': '/'
|
||||
}[s];
|
||||
});
|
||||
};
|
||||
|
||||
return me;
|
||||
})();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue