You are here

function clamav_get_file_scheme in ClamAV 7

Determine the scheme of a file object.

Parameters

$file: A file object.

Return value

The name of a stream wrapper scheme, or FALSE.

1 call to clamav_get_file_scheme()
clamav_file_validate in ./clamav.module
Implements hook_file_validate().

File

./clamav.module, line 136
Integrate ClamAV to allow uploaded files to be scanned for viruses.

Code

function clamav_get_file_scheme($file) {
  $scheme = file_uri_scheme($file->uri);

  // An ordinary file upload won't have a stream wrapper URI during validation;
  // instead there's a destination property.
  // @see: file_save_upload()
  if (empty($scheme) && isset($file->destination)) {
    $scheme = file_uri_scheme($file->destination);
  }
  return $scheme;
}