You are here

function _wsconfig_element_validate_json in Web Service Data 7

Validate json input

2 string references to '_wsconfig_element_validate_json'
wsconfig_edit_form in modules/wsconfig/wsconfig.admin.inc
Form callback: create or edit a wsconfig.
wsconfig_view_form in modules/wsconfig/wsconfig.admin.inc
Form callback: to view a wsconfig.

File

modules/wsconfig/wsconfig.admin.inc, line 538
Admin forms for wsconfig

Code

function _wsconfig_element_validate_json($element, &$form_state, $form) {
  if (is_null(drupal_json_decode($element['#value'])) and !empty($element['#value'])) {
    form_error($element, t('Invalid json format.'));
  }
}