aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2020-02-11 10:03:34 +0200
committerHenry Jameson <me@hjkos.com>2020-02-11 10:03:34 +0200
commit786a695eb6c4399bbbf3fe569cae0623c17b4618 (patch)
tree6266845710c0e632cb941ac8bc296778b73ce4f4 /src
parent6f3ac707f76b302e993eeb3eaeb415bc3d68502b (diff)
parent8fcb9c42aad9e623287c26244f079fc5028c6359 (diff)
Merge remote-tracking branch 'upstream/develop' into themes-accent
* upstream/develop: Fix one click nsfw unhide on videos Escape HTML from display name and subject fields
Diffstat (limited to 'src')
-rw-r--r--src/components/attachment/attachment.js11
-rw-r--r--src/services/entity_normalizer/entity_normalizer.service.js6
2 files changed, 12 insertions, 5 deletions
diff --git a/src/components/attachment/attachment.js b/src/components/attachment/attachment.js
index 06b496b0..b832e10f 100644
--- a/src/components/attachment/attachment.js
+++ b/src/components/attachment/attachment.js
@@ -2,6 +2,7 @@ import StillImage from '../still-image/still-image.vue'
import VideoAttachment from '../video_attachment/video_attachment.vue'
import nsfwImage from '../../assets/nsfw.png'
import fileTypeService from '../../services/file_type/file_type.service.js'
+import { mapGetters } from 'vuex'
const Attachment = {
props: [
@@ -49,7 +50,8 @@ const Attachment = {
},
fullwidth () {
return this.type === 'html' || this.type === 'audio'
- }
+ },
+ ...mapGetters(['mergedConfig'])
},
methods: {
linkClicked ({ target }) {
@@ -58,7 +60,7 @@ const Attachment = {
}
},
openModal (event) {
- const modalTypes = this.$store.getters.mergedConfig.playVideosInModal
+ const modalTypes = this.mergedConfig.playVideosInModal
? ['image', 'video']
: ['image']
if (fileTypeService.fileMatchesSomeType(modalTypes, this.attachment) ||
@@ -71,7 +73,10 @@ const Attachment = {
}
},
toggleHidden (event) {
- if (this.$store.getters.mergedConfig.useOneClickNsfw && !this.showHidden) {
+ if (
+ (this.mergedConfig.useOneClickNsfw && !this.showHidden) &&
+ (this.type !== 'video' || this.mergedConfig.playVideosInModal)
+ ) {
this.openModal(event)
return
}
diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js
index a3d0b782..3116d211 100644
--- a/src/services/entity_normalizer/entity_normalizer.service.js
+++ b/src/services/entity_normalizer/entity_normalizer.service.js
@@ -1,3 +1,5 @@
+import escape from 'escape-html'
+
const qvitterStatusType = (status) => {
if (status.is_post_verb) {
return 'status'
@@ -41,7 +43,7 @@ export const parseUser = (data) => {
}
output.name = data.display_name
- output.name_html = addEmojis(data.display_name, data.emojis)
+ output.name_html = addEmojis(escape(data.display_name), data.emojis)
output.description = data.note
output.description_html = addEmojis(data.note, data.emojis)
@@ -256,7 +258,7 @@ export const parseStatus = (data) => {
output.retweeted_status = parseStatus(data.reblog)
}
- output.summary_html = addEmojis(data.spoiler_text, data.emojis)
+ output.summary_html = addEmojis(escape(data.spoiler_text), data.emojis)
output.external_url = data.url
output.poll = data.poll
output.pinned = data.pinned