Skip to content

Conversation

@SandipBajracharya
Copy link
Collaborator

Changes

  • sanitize path before creating in Assembly

Testing Criteria

Loom

@linear
Copy link

linear bot commented Feb 4, 2026

@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dropbox-integration Ready Ready Preview, Comment Feb 4, 2026 11:36am

Request Review

Comment on lines 83 to 97
export function sanitizeFileNameForAssembly(filename: string): string {
const lastDotIndex = filename.lastIndexOf('.')

// if there's no extension, sanitize the whole filename
if (lastDotIndex === -1) {
return filename.replace(/[^a-zA-Z0-9_-]/g, ' ')
}

const name = filename.slice(0, lastDotIndex)
const extension = filename.slice(lastDotIndex + 1)

const sanitizedName = name.replace(/[^a-zA-Z0-9_-]/g, ' ')

return `${sanitizedName}.${extension}`
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
export function sanitizeFileNameForAssembly(filename: string): string {
const lastDotIndex = filename.lastIndexOf('.')
// if there's no extension, sanitize the whole filename
if (lastDotIndex === -1) {
return filename.replace(/[^a-zA-Z0-9_-]/g, ' ')
}
const name = filename.slice(0, lastDotIndex)
const extension = filename.slice(lastDotIndex + 1)
const sanitizedName = name.replace(/[^a-zA-Z0-9_-]/g, ' ')
return `${sanitizedName}.${extension}`
}
export function sanitizeFileNameForAssembly(filename: string): string {
const lastDotIndex = filename.lastIndexOf('.')
const sanitizedName = name.replace(/[^a-zA-Z0-9_-]/g, ' ')
// if there's no extension, sanitize the whole filename
if (lastDotIndex === -1) {
return sanitizedName
}
const name = sanitizedName.slice(0, lastDotIndex)
const extension = sanitizedName.slice(lastDotIndex + 1)
return `${sanitizedName}.${extension}`
}

File extensions don't have accent characters so this should be safe? Just a suggestion, wdyt?

@SandipBajracharya SandipBajracharya merged commit 2aceb19 into main Feb 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants