You are here

function favicon_form_system_theme_settings_validate in Favicon 7.2

Form validate handler for the system_theme_settings form.

1 string reference to 'favicon_form_system_theme_settings_validate'
favicon_form_system_theme_settings_alter in ./favicon.module
Implements hook_form_FORM_ID_alter().

File

./favicon.module, line 103
Module file for favicon module.

Code

function favicon_form_system_theme_settings_validate($form, $form_state) {
  if (!empty($form_state['values']['favicon_path'])) {
    if ($uri = _system_theme_settings_validate_path($form_state['values']['favicon_path'])) {
      try {
        DrupalFavicon::getFileFromUri($uri);
      } catch (DrupalFaviconValidationException $e) {
        form_set_error('favicon_path', filter_xss($e
          ->getMessage()));
      }
    }
  }
}