You are here

function analytics_amp_element_validate_config_url in Analytics 7

1 string reference to 'analytics_amp_element_validate_config_url'
AmpAnalyticsService::buildConfigurationForm in analytics_amp/src/AmpAnalyticsService.php
Form constructor.

File

analytics_amp/analytics_amp.module, line 21

Code

function analytics_amp_element_validate_config_url($element, &$form_state) {
  $value = $element['#value'];
  if ($value == '') {
    return;
  }
  elseif (file_valid_uri($value)) {

    // Allow file URIs like public:://config.json
    return;
  }
  else {
    elements_validate_url($element, $form_state);
  }
}