According to the code, and as it should be, the %post token is a safe token. However, the documentation (still) states
In addition to %get, the following super tokens may be used, though only with logged-in users: %server, %cookie, %request and %post. For example %server[HTTP_USER_AGENT] or %session[id].
Proposed documentation change:
'description' => t('In addition to %get, the following super tokens may be used, though only with logged-in users: %server, %cookie, %request and %post. For example %server[HTTP_USER_AGENT] or %session[id].'),
to:
'description' => t('In addition to %get, the following super tokens may be used: %post, %server, %cookie, and %request. However, except for %post, these may only be used with logged-in users. For example %server[HTTP_USER_AGENT] or %session[id].'),
But I'm not a native English speaker, so you might come up with a better formulation.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | webform_post_safe-d6.patch | 1.13 KB | quicksketch |
| #3 | webform_post_safe-d7.patch | 1.12 KB | quicksketch |
Comments
Comment #1
quicksketchI'll need to double-check if POST is safe or not. If a user visits a page at http://example.com/node/10 while submitting a POST request, the HTML rendered to the page may contain a %post[value] token set by Webform. If this value were cached in the page cache, that could cause some serious issues with one user's POST information being displayed to another anonymous user when http://example.com/node/10 is viewed.
I'm not clear right now whether or not Drupal tries to cache a page that is submitted as a POST request. If it doesn't cache pages that have been POST requested, then you're right that the %post tokens can be included as "safe".
Comment #2
fietserwinGood thinking, though POST should never be cached, not in browsers, not in proxies, and not in servers, not even if you could make the content of the post body part of the cache key, because a POST is allowed (assumed) to have side effects.
Anyway, I have sought this out for you (best way of learning how Drupal works):
File: bootstrap.inc
Oh: I just noticed that the documentation doesn't list %session as existing, it is only mentioned as an example. So that sentence need to be rephrased once more.
Comment #3
quicksketchI've committed these patches which update the token descriptions to reflect %post as a safe token.