Permalink
Browse files

in W3W surrounding spaces of query params removed before processing

  • Loading branch information...
1 parent 6b748be commit 715a984e28f0d5dd8d92ebe3769cdc1ca03aec6e Theo Lingen committed Apr 20, 2012
Showing with 13 additions and 12 deletions.
  1. +5 −5 Holumbus-Searchengine/src/Holumbus/Query/Result.hs
  2. +8 −7 W3W/src/Site.hs
@@ -57,13 +57,13 @@ where
import Prelude hiding (null)
import Control.DeepSeq
-import Control.Monad ( liftM2 )
+import Control.Monad ( liftM2 )
-import Data.Binary ( Binary (..) )
+import Data.Binary ( Binary (..) )
import Data.Function
-import Data.Map ( Map )
-import qualified Data.Map as M
-import qualified Data.List as L
+import Data.Map ( Map )
+import qualified Data.Map as M
+import qualified Data.List as L
import Holumbus.Utility
import Holumbus.Index.Common
View
@@ -26,15 +26,16 @@ import W3WState
import Control.Applicative
import Control.Monad.Trans
-import Data.List as L
-import Data.Map as M
-import Data.Maybe
-import Data.Text as T
-import Data.Text.Encoding as E
+import qualified Data.List as L
+import qualified Data.Map as M
+import Data.Maybe
+import qualified Data.Text as T
+import qualified Data.Text.Encoding as E
import Holumbus.Index.Common
import Holumbus.Query.Language.Grammar
import Holumbus.Query.Result
+import Holumbus.Utility ( strip )
import Prelude as P
@@ -97,8 +98,8 @@ queryFunction = do
getQueryStringParam :: String -> Application String
getQueryStringParam param = do
let decodedParam p = fromMaybe "" <$> getParam p
- query <- decodedParam $ encodeUtf8 $ T.pack param
- return $ T.unpack (E.decodeUtf8 query)
+ query <- decodedParam $ E.encodeUtf8 $ T.pack param
+ return . strip . T.unpack . E.decodeUtf8 $ query
-- ------------------------------------------------------------------------------
-- | creates a HTML List-Item containing a List with the link to the document found, the teasertext and the ranking-score

0 comments on commit 715a984

Please sign in to comment.