Skip to content

Commit 3478f39

Browse files
authored
Merge pull request #25234 from nextcloud/bugfix/noid/fix-encoding-issue-with-oc.notification.show
Fix encoding issue with OC.Notification.show
2 parents 349b65e + 613606f commit 3478f39

5 files changed

Lines changed: 14 additions & 5 deletions

File tree

core/js/dist/login.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/js/dist/login.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/js/dist/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/js/dist/main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/src/OC/notification.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,18 @@ export default {
115115
* @deprecated 17.0.0 use the `@nextcloud/dialogs` package
116116
*/
117117
show(text, options) {
118+
const escapeHTML = function(text) {
119+
return text.toString()
120+
.split('&').join('&')
121+
.split('<').join('&lt;')
122+
.split('>').join('&gt;')
123+
.split('"').join('&quot;')
124+
.split('\'').join('&#039;')
125+
}
126+
118127
options = options || {}
119128
options.timeout = (!options.timeout) ? TOAST_PERMANENT_TIMEOUT : options.timeout
120-
const toast = showMessage(text, options)
129+
const toast = showMessage(escapeHTML(text), options)
121130
toast.toastElement.toastify = toast
122131
return $(toast.toastElement)
123132
},

0 commit comments

Comments
 (0)