yesod-form 1.1.4 → 1.1.4.1
raw patch · 3 files changed
+12/−8 lines, 3 files
Files
- Yesod/Form/Functions.hs +1/−1
- Yesod/Form/Types.hs +10/−6
- yesod-form.cabal +1/−1
Yesod/Form/Functions.hs view
@@ -202,7 +202,7 @@ FormFailure [renderMessage m langs MsgCsrfWarning] _ -> res where (Just [t1]) === (Just t2) = TE.encodeUtf8 t1 `constTimeEq` TE.encodeUtf8 t2- Nothing === Nothing = True -- ^ It's important to use constTimeEq+ Nothing === Nothing = True -- It's important to use constTimeEq _ === _ = False -- in order to avoid timing attacks. return ((res', xml), enctype)
Yesod/Form/Types.hs view
@@ -18,6 +18,7 @@ , Field (..) , FieldSettings (..) , FieldView (..)+ , FieldViewFunc ) where import Control.Monad.Trans.RWS (RWST)@@ -123,14 +124,17 @@ , fvRequired :: Bool } +type FieldViewFunc sub master a+ = Text -- ^ ID+ -> Text -- ^ Name+ -> [(Text, Text)] -- ^ Attributes+ -> Either Text a -- ^ Either (invalid text) or (legitimate result)+ -> Bool -- ^ Required?+ -> GWidget sub master ()+ data Field sub master a = Field { fieldParse :: [Text] -> GHandler sub master (Either (SomeMessage master) (Maybe a))- , fieldView :: Text -- ^ ID- -> Text -- ^ Name- -> [(Text, Text)] -- ^ Attributes- -> Either Text a -- ^ Either (invalid text) or (legitimate result)- -> Bool -- ^ Required?- -> GWidget sub master ()+ , fieldView :: FieldViewFunc sub master a } data FormMessage = MsgInvalidInteger Text
yesod-form.cabal view
@@ -1,5 +1,5 @@ name: yesod-form-version: 1.1.4+version: 1.1.4.1 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>