packages feed

tellbot 0.6.0.6 → 0.6.0.7

raw patch · 4 files changed

+14/−8 lines, 4 files

Files

CHANGELOG.md view
@@ -1,6 +1,14 @@ tellbot CHANGELOG ================= +### 0.6.0.7++- Fixed IRC injection in HTML title.++### 0.6.0.6++- Fixed IRC injection in HTML title.+ ### 0.6.0.5  - Support for bifunctors-5.1.
src/HTML.hs view
@@ -32,7 +32,7 @@ dropTillTitle (_:xs) = dropTillTitle xs  chomp :: String -> String-chomp = unpack . strip . pack+chomp = filter (`notElem` "\r\n") . unpack . strip . pack  -- Filter an URL so that we don’t make overviews of unknown hosts. Pretty -- cool to prevent people from going onto sensitive websites.
src/Main.hs view
@@ -4,7 +4,7 @@ import Control.Monad.Except import Control.Monad.Trans.RWS import Data.Bifunctor ( bimap, second )-import Data.Char ( isAlphaNum, isPunctuation, toLower )+import Data.Char ( toLower ) import Data.Foldable ( toList ) import Data.List ( intersperse ) import Data.List.Split ( chunksOf, splitOn )@@ -19,7 +19,7 @@ import System.IO  version :: Version-version = Version [0,6,0,6] ["Apfelschorle"]+version = Version [0,6,0,7] ["Apfelschorle"]  type Server     = String type Chan       = String@@ -76,10 +76,8 @@ -- That function embeds a naive protection again IRC commands injection. toIRC :: String -> Session () toIRC msg = do-    let txt = protect msg-    unless (null txt) $ asks conHandle >>= lift . flip hPutStrLn txt-  where-    protect = takeWhile (\c -> isAlphaNum c || isPunctuation c || c == ' ')+    liftIO . putStrLn $ "DEBUG: sending: '" ++ msg ++ "'"+    unless (null msg) $ asks conHandle >>= lift . flip hPutStrLn msg  -- Receive a line from IRC. The line is formatted using the IRC protocol (RFC 1459). fromIRC :: Session String
tellbot.cabal view
@@ -1,5 +1,5 @@ name:                tellbot-version:             0.6.0.6+version:             0.6.0.7 synopsis:            IRC tellbot description:         An IRC bot that can be used to create queuing message.                      It also offers a simple administration IRC bot interface.