You are here

function querypath_examples_show_sparql_form_validate in QueryPath 6

Same name and namespace in other branches
  1. 7.3 querypath_examples.module \querypath_examples_show_sparql_form_validate()
  2. 7.2 querypath_examples.module \querypath_examples_show_sparql_form_validate()

File

./querypath_examples.module, line 323
The main file for querypath_examples.

Code

function querypath_examples_show_sparql_form_validate($form, &$form_state) {
  $query = $form_state['values']['sparql_name'];
  $query = check_plain($query);

  // Tags can goober things up.
  $query = addslashes($query);

  // Escape quotes.
  try {
    $out = querypath_examples_show_sparql_lookup($query);
    $_SESSION['out'] = $out;
  } catch (QueryPathException $qpe) {
    form_set_error('sparql_name', 'Could not submit query. This is likely due to a network problem.');
  }
}