MCPcopy Create free account
hub / github.com/error311/FileRise / normalizeUploadFileName

Method normalizeUploadFileName

src/FileRise/Domain/UploadModel.php:185–195  ·  view source on GitHub ↗
($value)

Source from the content-addressed store, hash-verified

183 }
184
185 private static function normalizeUploadFileName($value): ?string
186 {
187 if (!is_scalar($value)) {
188 return null;
189 }
190 $fileName = trim(urldecode((string)$value));
191 if (!UploadNamePolicy::isAllowedForWrite($fileName)) {
192 return null;
193 }
194 return $fileName;
195 }
196
197 private static function metadataFileForFolder(string $folder): string
198 {

Callers 1

handleUploadMethod · 0.95

Calls 1

isAllowedForWriteMethod · 0.80

Tested by

no test coverage detected