Skip to content

Kirby 4.0.1


Sanitizes the contents of a file by overwriting the file with the sanitized version; the sane handlers are automatically chosen by the extension and MIME type if not specified

Sane::sanitizeFile(string $file, string|bool $typeLazy = false): void


Name Type Default Description
$file * string
$typeLazy string|bool false Explicit handler type string,
true for lazy autodetection or
false for normal autodetection


Type Description
Kirby\Exception\InvalidArgumentException If the file didn't pass validation
Kirby\Exception\LogicException If more than one handler applies
Kirby\Exception\NotFoundException If the handler was not found
Kirby\Exception\Exception On other errors

Parent class