privatefunctionvalidateFileNameDoesNotEndOrStartWithDot(string $fileName): void { if(mb_substr($fileName, 0, 1) === '.'){ throw MediaException::illegalFileName($fileName, 'Filename must not start with a "." (dot).'); }
if(mb_substr($fileName, mb_strlen($fileName) - 1) === '.'){ throw MediaException::illegalFileName($fileName, 'Filename must not end with a "." (dot).'); }