function _drupal_invalid_token_set_form_error

_drupal_invalid_token_set_form_error()

Helper function to call form_set_error() if there is a token error.

Related topics

File

includes/form.inc, line 1135
Functions for form and batch generation and processing.

Code

function _drupal_invalid_token_set_form_error() {
  $path = current_path();
  $query = drupal_get_query_parameters();
  $url = url($path, array('query' => $query));

  // Setting this error will cause the form to fail validation.
  form_set_error('form_token', t('The form has become outdated. Copy any unsaved work in the form below and then <a href="@link">reload this page</a>.', array('@link' => $url)));
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!form.inc/function/_drupal_invalid_token_set_form_error/7.x