Reputation: 17553
I asked this question about reasons to use Drupal 7's Forms API as opposed to just processing form submission requests myself and eventually calling a function like node_save()
or comment_save()
. while a variety of reasons were given for using the Forms API, only one possible security vulnerability was raised: by not using Drupal 7's Forms API, I'd be missing out on the CSRF prevention techniques it uses. From what I've read, this basically involves the use of a token for validating requests.
My question is twofold:
Please note that I do not want this question to become a discussion of whether I should use the Forms API or not.
Upvotes: 0
Views: 834
Reputation: 31647
The token is generated by drupal_get_token() and validated using drupal_valid_token().
Upvotes: 1