You are here

function feedapi_simplified_form_validate in FeedAPI 6

Validates simplified form.

File

./feedapi.module, line 784
Handle the submodules (for feed and item processing) Provide a basic management of feeds

Code

function feedapi_simplified_form_validate($form, &$form_state) {
  if (!empty($form_state['values']['url']) && strpos($form_state['values']['url'], 'file://') === 0 && !user_access('use local files as feeds')) {
    form_set_error('url', t('You do not have sufficient permissions to use local files as feeds.'));
  }
  else {
    if (strpos($form_state['values']['url'], 'file://') === 0 && !file_check_location(substr($form_state['values']['feedapi']['feedapi_url'], 7), file_directory_path())) {
      form_set_error('url', t('file:// is only allowed for files under the files directory.'));
    }
  }
}