You are here

function clamav_scheme_is_scannable in ClamAV 7

Determine whether files of a given scheme should be scanned.

Parameters

$scheme: The name of the scheme.

Return value

TRUE or FALSE.

2 calls to clamav_scheme_is_scannable()
clamav_file_validate in ./clamav.module
Implements hook_file_validate().
clamav_scheme_options_defaults in ./clamav.admin.inc
Return defaults for scheme checkboxes.

File

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

Code

function clamav_scheme_is_scannable($scheme) {

  // By default all local schemes should be scannable.
  $local_schemes = array_keys(file_get_stream_wrappers(STREAM_WRAPPERS_LOCAL));
  $scheme_is_local = in_array($scheme, $local_schemes);

  // The default can be overridden per scheme.
  $overridden_schemes = variable_get('clamav_overridden_schemes', array());
  $scheme_is_overridden = in_array($scheme, $overridden_schemes);
  return $scheme_is_local xor $scheme_is_overridden;
}