You are here

function variablecheck_check_variables_form_validate in Variable Check 7

Ensure the form handler doesn't receive weird data that it shouldn't.

File

./variablecheck.module, line 138

Code

function variablecheck_check_variables_form_validate($form, &$form_state) {
  $variables = variablecheck_check_variables();
  $submitted = array_filter($form_state['values']['variables']);
  $missing = array_keys(array_diff_key($submitted, $variables));
  foreach ($missing as $name) {
    form_set_error('', t('The variable %name does not exist in the Drupal database.', array(
      '%name' => $name,
    )));
  }
}