You are here

charts_highcharts.install in Charts 8.3

Installation and update hooks for the Charts Highcharts module.

File

modules/charts_highcharts/charts_highcharts.install
View source
<?php

/**
 * @file
 * Installation and update hooks for the Charts Highcharts module.
 */

/**
 * Implements hook_requirements().
 */
function charts_highcharts_requirements($phase) {
  $requirements = [];
  if (function_exists('libraries_detect') && ($highcharts_info = libraries_detect('highcharts'))) {
    if (is_dir($highcharts_info['library path'] . '/js/exporting-server')) {
      $requirements['highcharts_security'] = [
        'title' => t('Highcharts vulnerability'),
        'severity' => REQUIREMENT_ERROR,
        'value' => t('Dangerous sample code present'),
        'description' => t('Your installation of the Highcharts library at "@path" contains a directory named "exporting-server". This directory contains dangerous sample files that may compromise the security of your site. You must delete this directory before you may use the Charts Highcharts module.', [
          '@path' => $highcharts_info['library path'],
        ]),
      ];
    }
  }
  return $requirements;
}

Functions