diff options
-rw-r--r-- | Foundation.hs | 13 |
1 files changed, 13 insertions, 0 deletions
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 | |||
123 | -- error pages | 123 | -- error pages |
124 | defaultMessageWidget title body = $(widgetFile "default-message-widget") | 124 | defaultMessageWidget title body = $(widgetFile "default-message-widget") |
125 | 125 | ||
126 | cleanPath _ s = if corrected == s | ||
127 | then Right $ filter (not . null) s | ||
128 | else Left corrected | ||
129 | where | ||
130 | corrected = rds s | ||
131 | |||
132 | rds [] = [] | ||
133 | rds [x] = [x] | ||
134 | rds (x:y:ss) | ||
135 | | null x | ||
136 | , null y = rds (x:ss) | ||
137 | | otherwise = x : rds (y:ss) | ||
138 | |||
126 | -- How to run database actions. | 139 | -- How to run database actions. |
127 | instance YesodPersist App where | 140 | instance YesodPersist App where |
128 | type YesodPersistBackend App = SqlBackend | 141 | type YesodPersistBackend App = SqlBackend |