Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions packages/renderless/src/file-upload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,10 @@ export const properFileSize =
if (state.isEdm || (Array.isArray(props.fileSize) && props.fileSize[1])) {
if (!isNaN(Number(maxSize)) && file.size > maxSize * 1024 * 1024) {
Modal.message({
message: t(constants.EDM.EXCEED, { maxSize: api.formatFileSize(Number(maxSize * 1024 * 1024)) }),
message: t(constants.EDM.EXCEED, {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the fileName property is correctly populated and sanitized to prevent any potential security issues, such as script injection, when displaying file names in messages.

fileName: file.name,
maxSize: api.formatFileSize(Number(maxSize * 1024 * 1024))
}),
status: 'warning'
})

Expand All @@ -402,7 +405,7 @@ export const properFileSize =

if (file.size <= userMin * 1024) {
Modal.message({
message: `${t(constants.EDM.SIZE, { minSize: api.formatFileSize(Number(userMin), 'KB'), sizeUnit: '' })}`,
message: `${t(constants.EDM.SIZE, { fileName: file.name, minSize: api.formatFileSize(Number(userMin), 'KB'), sizeUnit: '' })}`,
status: 'warning'
})

Expand Down
4 changes: 2 additions & 2 deletions packages/vue-locale/src/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ export default {
folder: 'The file cannot be uploaded because it is more than five-folder levels deep.',
init: 'Service error. Please try again.',
token: 'Before starting, perform EDM authentication and obtain the token.',
exceed: 'The file size exceeds the upper limit ({maxSize}).',
exceed: '{fileName} The file size exceeds the upper limit ({maxSize}).',
largeFile: 'The file exceeds 2 GB.',
fileSize: 'The file is less than the minimum size ({minSize} {sizeUnit}).',
fileSize: '{fileName} The file is less than the minimum size ({minSize} {sizeUnit}).',
deleteTip: 'Press the Delete key.',
downloadFile: 'Download',
previewFile: 'Preview',
Expand Down
4 changes: 2 additions & 2 deletions packages/vue-locale/src/lang/es-LA.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ export default {
folder: 'No se puede cargar el archivo porque tiene más de cinco niveles de profundidad.',
init: 'Error de servicio. Vuelva a intentarlo.',
token: 'Antes de comenzar, realice la autenticación de EDM y obtenga el token.',
exceed: 'El tamaño del archivo supera el límite superior ({maxSize}).',
exceed: '{fileName} El tamaño del archivo supera el límite superior ({maxSize}).',
largeFile: 'El archivo supera los 2 GB.',
fileSize: ' El tamaño del archivo es inferior al mínimo ({minSize} {sizeUnit}).',
fileSize: '{fileName} El tamaño del archivo es inferior al mínimo ({minSize} {sizeUnit}).',
deleteTip: 'Presione la tecla Suprimir.',
downloadFile: 'Descargar',
previewFile: 'Vista previa',
Expand Down
4 changes: 2 additions & 2 deletions packages/vue-locale/src/lang/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ export default {
folder: 'O arquivo não pode ser carregado porque tem mais de cinco níveis de profundidade.',
init: 'Erro de serviço. Tente novamente mais tarde.',
token: 'Antes de iniciar, realize a autenticação EDM e obtenha o token.',
exceed: 'O tamanho do arquivo excede o limite máximo ({maxSize}).',
exceed: '{fileName} O tamanho do arquivo excede o limite máximo ({maxSize}).',
largeFile: 'O arquivo excede 2 GB.',
fileSize: 'O arquivo é menor que o tamanho mínimo ({minSize} {sizeUnit}).',
fileSize: '{fileName} O arquivo é menor que o tamanho mínimo ({minSize} {sizeUnit}).',
deleteTip: 'Pressione a tecla Delete.',
downloadFile: 'Baixar',
previewFile: 'Pré-visualizar',
Expand Down
4 changes: 2 additions & 2 deletions packages/vue-locale/src/lang/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ export default {
folder: '文件所在文件夹层数已超过 5 层,将不会上传该文件',
init: '服务报错,请重试',
token: '请先进行 EDM 鉴权,获取 token',
exceed: '文件大小超过限制({maxSize})',
exceed: '{fileName} 文件大小超过限制({maxSize})',
largeFile: '文件大小超出限制 2G !!',
fileSize: '文件大小低于限制({minSize}{sizeUnit})',
fileSize: '{fileName} 文件大小低于限制({minSize}{sizeUnit})',
deleteTip: '按 delete 键可删除',
downloadFile: '下载文件',
previewFile: '预览文件',
Expand Down
Loading