aboutsummaryrefslogtreecommitdiff
path: root/src/Model
diff options
context:
space:
mode:
authorJoris2015-09-02 17:38:46 +0200
committerJoris2015-09-02 17:38:46 +0200
commit02102713eae95fd6f42ff7681a640e43c5ba6d3d (patch)
treeb22000da41aed0436cb2d40abb5ce901e8276e0e /src/Model
parentc17f89ef439a0b2e5a4511d8cdd55b2cfeb671b9 (diff)
Authorize materials with spaces
Diffstat (limited to 'src/Model')
-rw-r--r--src/Model/URL.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Model/URL.hs b/src/Model/URL.hs
index 76a9e86..04fcf6b 100644
--- a/src/Model/URL.hs
+++ b/src/Model/URL.hs
@@ -13,7 +13,12 @@ import qualified Data.Text as T
type URL = Text
getIdURL :: Text -> URL
-getIdURL material = T.concat [site, "/ajax/global.php?term=", material]
+getIdURL material =
+ T.concat
+ [ site
+ , "/ajax/global.php?term="
+ , T.replace " " "+" material
+ ]
getMaterialURL :: Text -> URL
getMaterialURL materialId = T.concat [site, "/fiche-matiere-", materialId, ".php"]