You are here

function feed_import_element_validate_json in Feed Import 7.3

Same name and namespace in other branches
  1. 8 feed_import.module \feed_import_element_validate_json()

Validates JSON code

1 string reference to 'feed_import_element_validate_json'
feed_import_feed_import_reader_info in ./feed_import.module
Implements hook_feed_import_reader_info().

File

./feed_import.module, line 2751
User interface, cron functions for feed_import module

Code

function feed_import_element_validate_json($element, &$form_state, $form) {
  if ($element['#value'] && !@json_decode($element['#value'])) {
    form_error($element, t('%title contains invalid JSON code!', array(
      '%title' => $element['#title'],
    )));
  }
}