MCPcopy Index your code
hub / github.com/codeaashu/claude-code / sanitizeFileName

Function sanitizeFileName

src/bridge/inboundAttachments.ts:55–58  ·  view source on GitHub ↗

* Strip path components and keep only filename-safe chars. file_name comes * from the network (web composer), so treat it as untrusted even though the * composer controls it.

(name: string)

Source from the content-addressed store, hash-verified

53 * composer controls it.
54 */
55function sanitizeFileName(name: string): string {
56 const base = basename(name).replace(/[^a-zA-Z0-9._-]/g, '_')
57 return base || 'attachment'
58}
59
60function uploadsDir(): string {
61 return join(getClaudeConfigHomeDir(), 'uploads', getSessionId())

Callers 1

resolveOneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected