runFormPost: proper behavior for missing input #950

This commit is contained in:
Michael Snoyman 2015-03-11 07:24:47 +02:00
parent 376b6f9c0d
commit f8847bd231
3 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,7 @@
## 1.4.4.1
* runFormPost has wrong behavior for empty forms [#950](https://github.com/yesodweb/yesod/issues/950)
## 1.4.4
* Add a `Semigroup` instance

View File

@ -223,6 +223,7 @@ postHelper form env = do
((res, xml), enctype) <- runFormGeneric (form token) m langs env
let res' =
case (res, env) of
(_, Nothing) -> FormMissing
(FormSuccess{}, Just (params, _))
| not (Map.lookup tokenKey params === reqToken req) ->
FormFailure [renderMessage m langs MsgCsrfWarning]

View File

@ -1,5 +1,5 @@
name: yesod-form
version: 1.4.4
version: 1.4.4.1
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>