From 089ba7d7f860022780da9d426207dc7fe3507a55 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 16 Mar 2017 17:47:07 +0100 Subject: Roll own cleanPath --- Foundation.hs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Foundation.hs b/Foundation.hs index d7425d5..8b3fe46 100644 --- a/Foundation.hs +++ b/Foundation.hs @@ -123,6 +123,19 @@ instance Yesod App where -- error pages defaultMessageWidget title body = $(widgetFile "default-message-widget") + cleanPath _ s = if corrected == s + then Right $ filter (not . null) s + else Left corrected + where + corrected = rds s + + rds [] = [] + rds [x] = [x] + rds (x:y:ss) + | null x + , null y = rds (x:ss) + | otherwise = x : rds (y:ss) + -- How to run database actions. instance YesodPersist App where type YesodPersistBackend App = SqlBackend -- cgit v1.2.3