Skip to content

Commit 68ca1f9

Browse files
authored
Merge pull request #8689 from nextcloud/backport/8687/stable30
[stable30] fix(mediaHandler): strip relevant bidi chars in filenames
2 parents 3e0f124 + e106e86 commit 68ca1f9

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
@@ -167,7 +167,10 @@ export default {
167167
})
168168
},
169169
insertAttachment(name, fileId, mimeType, position = null, dirname = '') {
170-
const sanitizedName = name.replaceAll('\u202E', '')
170+
const sanitizedName = name.replace(
171+
/[\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,
172+
'',
173+
)
171174
// inspired by the fixedEncodeURIComponent function suggested in
172175
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
173176
const src = dirname + '/'

0 commit comments

Comments
 (0)