Skip to content

Commit 09364cc

Browse files
committed
N°4386 - Remove deprecated EncodeHtml in utils.js
1 parent 4bbd1fe commit 09364cc

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

js/utils.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -613,33 +613,6 @@ function ExportInitButton(sSelector) {
613613
});
614614
}
615615

616-
/**
617-
* @deprecated 3.0.0 N°4367 deprecated, use {@see CombodoSanitizer.EscapeHtml} instead
618-
*
619-
* @param sValue value to escape
620-
* @param bReplaceAmp if false don't replace "&" (can be useful when sValue contains html entities we want to keep)
621-
* @returns {string} escaped value, ready to insert in the DOM without XSS risk
622-
*
623-
* @since 2.6.5, 2.7.2, 3.0.0 N°3332
624-
* @see https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html#rule-1-html-encode-before-inserting-untrusted-data-into-html-element-content
625-
* @see https://stackoverflow.com/questions/295566/sanitize-rewrite-html-on-the-client-side/430240#430240 why inserting in the DOM (for
626-
* example the text() JQuery way) isn't safe
627-
*/
628-
function EncodeHtml(sValue, bReplaceAmp) {
629-
var sEncodedValue = (sValue+'')
630-
.replace(/</g, '&lt;')
631-
.replace(/>/g, '&gt;')
632-
.replace(/"/g, '&quot;')
633-
.replace(/'/g, '&#x27;')
634-
.replace(/\//g, '&#x2F;');
635-
636-
if (bReplaceAmp) {
637-
sEncodedValue = sEncodedValue.replace(/&/g, '&amp;');
638-
}
639-
640-
return sEncodedValue;
641-
}
642-
643616
// Very simple equivalent to format: placeholders are %1$s %2$d ...
644617
function Format() {
645618
var args = [];

0 commit comments

Comments
 (0)