aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlban Gruin2021-09-19 12:04:15 +0200
committerAlban Gruin2021-09-19 12:36:21 +0200
commita5e7ab75ed9ff253df73cf951140748ce41503c4 (patch)
tree11b5ab494d0f36e4f81d47cdcd4ae71f513d248e
parent7d2c0eb7a2e0cfbecbb52b6a337f252433614fa4 (diff)
pages: escape parameters in pages, update copyright
Signed-off-by: Alban Gruin <alban at pa1ch dot fr>
-rw-r--r--src/pages.ml11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/pages.ml b/src/pages.ml
index a031599..2cb0aa4 100644
--- a/src/pages.ml
+++ b/src/pages.ml
@@ -1,5 +1,5 @@
(*
- * Copyright (C) 2020 Alban Gruin
+ * Copyright (C) 2020, 2021 Alban Gruin
*
* ucs is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
@@ -15,6 +15,9 @@
* along with ucs. If not, see <http://www.gnu.org/licenses/>.
*)
+let escape str =
+ Stringext.replace_all_assoc str ["<", "&lt;"; ">", "&gt"]
+
let common content =
{|<!DOCTYPE html>
<html lang="fr">
@@ -31,7 +34,7 @@ let common content =
<article>|} ^ content ^
{| </article>
<footer>
- <p>(c) 2020 &ndash; Alban Gruin &ndash; µCS |} ^ Version.version () ^ {| « CANIS MINOR »</p>
+ <p>(c) 2021 &ndash; Alban Gruin &ndash; µCS |} ^ escape (Version.version ()) ^ {| « CANIS MINOR »</p>
</footer>
</body>
</html>
@@ -88,7 +91,9 @@ d’Apple), et ainsi attirer plus d’utilisateurs ? -->
</section>
|}
-let link lnk = common @@ {|
+let link lnk =
+ let lnk = escape lnk in
+ common @@ {|
<section>
<h3>Lien de l'emploi du temps</h3>
<a href="|} ^ lnk ^ {|">|} ^ lnk ^ {|</a>