Skip to content

Commit b6370d4

Browse files
authored
Merge pull request #8687 from nextcloud/fix/strip-bidi-chars-in-filenames
fix(mediaHandler): strip relevant bidi chars in filenames
2 parents 8e62fc8 + 3efb50b commit b6370d4

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
@@ -228,7 +228,10 @@ export default {
228228
this.editor.chain().focus().insertPreview(href).run()
229229
},
230230
insertAttachment(name, fileId, mimeType, position = null, dirname = '') {
231-
const sanitizedName = name.replaceAll('\u202E', '')
231+
const sanitizedName = name.replace(
232+
/[\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,
233+
'',
234+
)
232235
// inspired by the fixedEncodeURIComponent function suggested in
233236
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
234237
const src =

0 commit comments

Comments
 (0)