Fix encoding issue with OC.Notification.show

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/25244/head
Joas Schilling 3 years ago
parent 5f5203a285
commit b7d8b3a72d
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -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) ? -1 : options.timeout
const toast = showMessage(text, options)
const toast = showMessage(escapeHTML(text), options)
toast.toastElement.toastify = toast
return $(toast.toastElement)
},

Loading…
Cancel
Save