Skip to content

Commit b7d8b3a

Browse files
committed
Fix encoding issue with OC.Notification.show
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 5f5203a commit b7d8b3a

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('&amp;')
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) ? -1 : 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)