Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-01-20 16:44:39 +0300
committerJoas Schilling <coding@schilljs.com>2021-01-20 16:44:39 +0300
commit613606fb88d4dd06d84455e60ab0229237da6b36 (patch)
tree47ea886dfeff6b984da400c96ee48eb09d39ec9c /core/src
parent2c9345a3c674c333e863c21ca249cb336c91fbff (diff)
Fix encoding issue with OC.Notification.show
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core/src')
-rw-r--r--core/src/OC/notification.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/src/OC/notification.js b/core/src/OC/notification.js
index adac95f1d37..8b7e43373a6 100644
--- a/core/src/OC/notification.js
+++ b/core/src/OC/notification.js
@@ -115,9 +115,18 @@ export default {
* @deprecated 17.0.0 use the `@nextcloud/dialogs` package
*/
show(text, options) {
+ const escapeHTML = function(text) {
+ return text.toString()
+ .split('&').join('&amp;')
+ .split('<').join('&lt;')
+ .split('>').join('&gt;')
+ .split('"').join('&quot;')
+ .split('\'').join('&#039;')
+ }
+
options = options || {}
options.timeout = (!options.timeout) ? TOAST_PERMANENT_TIMEOUT : options.timeout
- const toast = showMessage(text, options)
+ const toast = showMessage(escapeHTML(text), options)
toast.toastElement.toastify = toast
return $(toast.toastElement)
},