Merge pull request #23548 from nextcloud/backport/23264/stable20

[stable20] Add local version of escapeHTML
This commit is contained in:
blizzz 2020-10-19 09:32:26 +02:00 committed by GitHub
commit 52f873942c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -57,6 +57,14 @@ function highlightInput($input) {
* @param {int} userListLimit page size for result list * @param {int} userListLimit page size for result list
*/ */
function addSelect2 ($elements, userListLimit) { function addSelect2 ($elements, userListLimit) {
var escapeHTML = function (text) {
return text.toString()
.split('&').join('&')
.split('<').join('&lt;')
.split('>').join('&gt;')
.split('"').join('&quot;')
.split('\'').join('&#039;');
};
if (!$elements.length) { if (!$elements.length) {
return; return;
} }