-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: 5.8.0-HF36
-
Fix Version/s: 5.8.0-HF41
-
Component/s: Seam / JSF UI
NXP-17807 introduces this error.
This can be fixed by using the code from recent version
diff --git a/nuxeo-features/nuxeo-platform-ui-select2/src/main/resources/web/nuxeo.war/scripts/select2/nuxeo-select2.js b/nuxeo-features/nuxeo-platform-ui-select2/src/main/resources/web/nuxeo.war/scripts/select2/nuxeo-select2.js index 820f703..2fa4ddc 100644 --- a/nuxeo-features/nuxeo-platform-ui-select2/src/main/resources/web/nuxeo.war/scripts/select2/nuxeo-select2.js +++ b/nuxeo-features/nuxeo-platform-ui-select2/src/main/resources/web/nuxeo.war/scripts/select2/nuxeo-select2.js @@ -1,8 +1,18 @@ (function() { + var entityMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '/': '/' + }; + function escapeHTML(string) { - // prototype.js allows us to use escapeHTML on strings - return string.escapeHTML(); + return String(string).replace(/[&<>"'\/]/g, function fromEntityMap (s) { + return entityMap[s]; + }); }
or by checking if the string is null
diff --git a/nuxeo-features/nuxeo-platform-ui-select2/src/main/resources/web/nuxeo.war/scripts/select2/nuxeo-select2.js b/nuxeo-features/nuxeo-platform-ui-select2/src/main/resources/web/nuxeo.war/scripts/select2/nuxeo-select2.js index 820f703..d1a2639 100644 --- a/nuxeo-features/nuxeo-platform-ui-select2/src/main/resources/web/nuxeo.war/scripts/select2/nuxeo-select2.js +++ b/nuxeo-features/nuxeo-platform-ui-select2/src/main/resources/web/nuxeo.war/scripts/select2/nuxeo-select2.js @@ -1,6 +1,9 @@ (function() { function escapeHTML(string) { + if (string == null) { + return string; + } // prototype.js allows us to use escapeHTML on strings return string.escapeHTML(); }