You are here

public function InstagramFeedsPluginsPager::sourceFormValidate in Instagram Feeds 7

Override parent::sourceFormValidate().

File

modules/instagram_feeds_plugins/plugins/feeds/InstagramFeedsPluginsPager.inc, line 214
Home of the InstagramFeedsPluginsPager.

Class

InstagramFeedsPluginsPager
Fetches data via Instagram API with the ability to page all results.

Code

public function sourceFormValidate(&$values) {
  if (!feeds_valid_url($values['source'], TRUE)) {
    $form_key = 'feeds][' . get_class($this) . '][source';
    form_set_error($form_key, t('The URL %source is invalid.', array(
      '%source' => $values['source'],
    )));
  }
  elseif ($this->config['auto_detect_feeds']) {
    feeds_include_library('http_request.inc', 'http_request');
    if ($url = http_request_get_common_syndication($values['source'], array(
      'accept_invalid_cert' => TRUE,
    ))) {
      $values['source'] = $url;
    }
  }
}