Skip to content

Commit

Permalink
Merge pull request #527 from fg-uulm/fix-injection
Browse files Browse the repository at this point in the history
fix injection vuln (issue #525)
  • Loading branch information
zanllp authored Mar 2, 2024
2 parents 436138b + 8cd54cd commit 390eba2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions vue/src/page/fileTransfer/fullScreenContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ const selectedTag = computed(() => tagStore.tagMap.get(props.file.fullpath) ?? [
const currImgResolution = ref('')
const q = createReactiveQueue()
const imageGenInfo = ref('')
const geninfoFrags = computed(() => imageGenInfo.value.split('\n'))
const geninfoStruct = computed(() => parse(imageGenInfo.value))
const cleanImageGenInfo = ref('')
const geninfoFrags = computed(() => cleanImageGenInfo.value.split('\n'))
const geninfoStruct = computed(() => parse(cleanImageGenInfo.value))
const geninfoStructNoPrompts = computed(() => {
let p = parse(imageGenInfo.value)
let p = parse(cleanImageGenInfo.value)
delete p.prompt
delete p.negativePrompt
return p
Expand All @@ -58,6 +59,11 @@ watch(
q.tasks.forEach((v) => v.cancel())
q.pushAction(() => getImageGenerationInfo(path)).res.then((v) => {
imageGenInfo.value = v
cleanImageGenInfo.value = v.replace(/&/g, "&")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#39;");
})
},
{ immediate: true }
Expand Down

0 comments on commit 390eba2

Please sign in to comment.