MCPcopy Index your code
hub / github.com/aptly-dev/aptly / SanitizePath

Function SanitizePath

utils/utils.go:28–34  ·  view source on GitHub ↗

SanitizePath removes leading '/', remove '..', '$' and '`'

(path string)

Source from the content-addressed store, hash-verified

26
27// SanitizePath removes leading '/', remove '..', '$' and '`'
28func SanitizePath(path string) (result string) {
29 result = strings.Replace(path, "..", "", -1)
30 result = strings.Replace(result, "$", "", -1)
31 result = strings.Replace(result, "`", "", -1)
32 result = strings.TrimLeft(result, "/")
33 return
34}

Callers 12

apiReposPackageFromDirFunction · 0.92
apiFilesUploadFunction · 0.92
apiFilesUploadOneFunction · 0.92
apiFilesListFilesFunction · 0.92
apiFilesDeleteDirFunction · 0.92
apiFilesDeleteFileFunction · 0.92
apiGPGAddKeyFunction · 0.92
apiGPGListKeysFunction · 0.92
apiGPGDeleteKeyFunction · 0.92
slashEscapeFunction · 0.92
apiPublishRepoOrSnapshotFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected