You are here

function clamav_update_7002 in ClamAV 7

Reconfigure ClamAV to show that files are being scanned.

File

./clamav.install, line 76
Hook_requirements for the ClamAV module.

Code

function clamav_update_7002() {

  // See http://drupal.org/node/2810103
  // The configuration checkbox 'Enable ClamAV anti-virus scans' previously had
  // no effect on whether files were scanned: files were *always* scanned, even
  // if that checkbox was disabled.
  // This bug is now fixed, so reconfigure ClamAV so that the behaviour does
  // not change.
  if (!variable_get('clamav_enabled', TRUE)) {
    variable_set('clamav_enabled', TRUE);
    watchdog('ClamAV', 'ClamAV has been reconfigured and is enabled for scanning uploads. Learn more at <a href="@clamav_issue_url">Issue 2810103 on drupal.org</a>.', array(
      '@clamav_issue_url' => url('http://drupal.org/node/2810103'),
    ), WATCHDOG_WARNING);
    $message = t('ClamAV has been reconfigured and is enabled to scan uploads. Visit the <a href="@clamav_config_url">ClamAV configuration page</a> to review the configuration and disable it if necessary.', array(
      '@clamav_config_url' => url('admin/config/media/clamav'),
    ));
    return $message;
  }
}