Skip to content

Commit 8f23af3

Browse files
authored
Merge pull request #8691 from nextcloud/backport/8687/stable32
[stable32] fix(mediaHandler): strip relevant bidi chars in filenames
2 parents b2cab75 + 639ec35 commit 8f23af3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/components/Editor/MediaHandler.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,10 @@ export default {
230230
this.editor.chain().focus().insertPreview(href).run()
231231
},
232232
insertAttachment(name, fileId, mimeType, position = null, dirname = '') {
233-
const sanitizedName = name.replaceAll('\u202E', '')
233+
const sanitizedName = name.replace(
234+
/[\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,
235+
'',
236+
)
234237
// inspired by the fixedEncodeURIComponent function suggested in
235238
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
236239
const src =

0 commit comments

Comments
 (0)