You are here

public function FileInsertHookHandler::process in SVG Upload Sanitizer 8

Try to sanitize the inserted file.

Parameters

\Drupal\file\FileInterface $file: The file.

Return value

bool TRUE if the file was sanitized, FALSE otherwise.

Throws

\Exception

File

src/HookHandler/FileInsertHookHandler.php, line 68

Class

FileInsertHookHandler
Hook handler for the file_insert() hook.

Namespace

Drupal\svg_upload_sanitizer\HookHandler

Code

public function process(FileInterface $file) {
  if (!$this->sanitizerHelper
    ->sanitize($file)) {
    return FALSE;
  }
  return $this->fileHelper
    ->updateSize($file);
}