Skip to content

Commit

Permalink
fix(NewMessage): store caption without html escaping
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
  • Loading branch information
DorraJaouad committed Dec 5, 2023
1 parent 7d1134e commit 29e1e81
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/components/NewMessage/NewMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,14 @@ export default {
}
}
// FIXME upstream: https://github.com/nextcloud-libraries/nextcloud-vue/issues/4492
if (this.hasText) {
const temp = document.createElement('textarea')
temp.innerHTML = this.text.replace(/&/gmi, '&amp;')
this.text = temp.value.replace(/&amp;/gmi, '&').replace(/&lt;/gmi, '<')
.replace(/&gt;/gmi, '>').replace(/&sect;/gmi, '§')
}
if (this.upload) {
// Clear input content from store
this.$store.dispatch('setCurrentMessageInput', { token: this.token, text: '' })
Expand All @@ -521,12 +529,6 @@ export default {
}
if (this.hasText) {
// FIXME upstream: https://github.com/nextcloud-libraries/nextcloud-vue/issues/4492
const temp = document.createElement('textarea')
temp.innerHTML = this.text.replace(/&/gmi, '&amp;')
this.text = temp.value.replace(/&amp;/gmi, '&').replace(/&lt;/gmi, '<')
.replace(/&gt;/gmi, '>').replace(/&sect;/gmi, '§')
const temporaryMessage = await this.$store.dispatch('createTemporaryMessage', {
text: this.text.trim(),
token: this.token,
Expand Down

0 comments on commit 29e1e81

Please sign in to comment.