protected function validateUpload(UploadedFileInterface $file): void
    {
        // Handle bad filenames.
        $filename = $file->getClientFilename();

        if (!Utils::checkFilename($filename)) {
            $grav = Grav::instance();
            throw new \RuntimeException(
                sprintf($grav['language']->translate('PLUGIN_FORM.FILEUPLOAD_UNABLE_TO_UPLOAD', null, true), $filename, 'Bad filename')
            );
        }
    }
protected function validateUpload(UploadedFileInterface $file): void
    {
        // Handle bad filenames.
        $filename = $file->getClientFilename();

        if (!Utils::checkFilename($filename)) {
            $grav = Grav::instance();
            throw new \RuntimeException(
                sprintf($grav['language']->translate('PLUGIN_FORM.FILEUPLOAD_UNABLE_TO_UPLOAD', null, true), $filename, 'Bad filename')
            );
        }
    }
protected function validateUpload ( UploadedFileInterface $ file ) : void { // Handle bad filenames. $ filename = $ file -> getClientFilename ( ) ; if ( ! Utils :: checkFilename ( $ filename ) ) { $ grav = Grav :: instance ( ) ; throw new \ RuntimeException ( sprintf ( $ grav [ 'language' ] -> translate ( 'PLUGIN_FORM.FILEUPLOAD_UNABLE_TO_UPLOAD' , null , true ) , $ filename , 'Bad filename' ) ) ; } }
Validate uploaded file.

@param UploadedFileInterface $file
Validate uploaded file .