update to xss-sanitize 0.3

This commit is contained in:
Greg Weber 2011-08-09 10:24:51 -07:00
parent 3f5c8f1dd3
commit ce3c909218
3 changed files with 6 additions and 6 deletions

View File

@ -32,7 +32,7 @@ import Yesod.Form.Types
import Yesod.Widget
import Yesod.Message (RenderMessage, SomeMessage (..))
import Text.Hamlet
import Text.Blaze (ToHtml (..), preEscapedString, unsafeByteString)
import Text.Blaze (ToHtml (..), preEscapedText, unsafeByteString)
import Text.Cassius
import Data.Time (Day, TimeOfDay(..))
import qualified Text.Email.Validate as Email
@ -171,7 +171,7 @@ timeField = Field
htmlField :: RenderMessage master FormMessage => Field sub master Html
htmlField = Field
{ fieldParse = blank $ Right . preEscapedString . sanitizeBalance . unpack -- FIXME make changes to xss-sanitize
{ fieldParse = blank $ Right . preEscapedText . sanitizeBalance
, fieldView = \theId name val _isReq -> addHamlet
[HAMLET|\
<textarea id="#{theId}" name="#{name}" .html>#{showVal val}

View File

@ -17,9 +17,9 @@ import Text.HTML.SanitizeXSS (sanitizeBalance)
import Text.Hamlet (Html, html)
import Text.Julius (julius)
import Text.Blaze.Renderer.String (renderHtml)
import Text.Blaze (preEscapedString)
import Text.Blaze (preEscapedText)
import Control.Monad.Trans.Class (lift)
import Data.Text (Text, pack, unpack)
import Data.Text (Text, pack)
import Data.Maybe (listToMaybe)
class YesodNic a where
@ -29,7 +29,7 @@ class YesodNic a where
nicHtmlField :: YesodNic master => Field sub master Html
nicHtmlField = Field
{ fieldParse = return . Right . fmap (preEscapedString . sanitizeBalance . unpack) . listToMaybe -- FIXME
{ fieldParse = return . Right . fmap (preEscapedText . sanitizeBalance) . listToMaybe
, fieldView = \theId name val _isReq -> do
addHtml
#if __GLASGOW_HASKELL__ >= 700

View File

@ -23,7 +23,7 @@ library
, template-haskell
, transformers >= 0.2.2 && < 0.3
, data-default >= 0.3 && < 0.4
, xss-sanitize >= 0.2.4 && < 0.3
, xss-sanitize >= 0.3 && < 0.4
, blaze-builder >= 0.2.1 && < 0.4
, network >= 2.2 && < 2.4
, email-validate >= 0.2.6 && < 0.3