From fe61a79141d68813eb73c0f705801ead043ed4a5 Mon Sep 17 00:00:00 2001 From: xoy Date: Sun, 29 Jan 2023 16:33:16 +0100 Subject: [PATCH] fehlerbehebung --- html.go | 12 +++++++++--- http.go | 2 -- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/html.go b/html.go index d1a897c..c588804 100644 --- a/html.go +++ b/html.go @@ -77,9 +77,9 @@ func htmlReplacer(input string, activePage string) string { break } - tempA = htmlElement("h2", Event.title, "") - tempA += htmlElement("p", Event.description, "") - tempA += htmlElement("p", Event.date, "") + tempA = htmlElement("h2", htmlClean(Event.title), "") + tempA += htmlElement("p", htmlClean(Event.description), "") + tempA += htmlElement("p", htmlClean(Event.date), "") tempB += htmlElement("div", tempA, "class=\"event\"") } output = strings.ReplaceAll(output, "!EVENTS", htmlElement("div", tempB, "class=\"eventList\"")) @@ -96,3 +96,9 @@ func htmlReplacer(input string, activePage string) string { return output } + +func htmlClean(htmlString string) string { + htmlString = strings.ReplaceAll(htmlString, "<", "[") + htmlString = strings.ReplaceAll(htmlString, ">", "]") + return htmlString +} diff --git a/http.go b/http.go index 50163d3..ea533b7 100644 --- a/http.go +++ b/http.go @@ -79,9 +79,7 @@ func httpHandleFuncWithPOST(urlPath string, filepath string, contentType string) errorPanic(err) } logger("event added!") - logger("----------------HANDLE IMAGES----------------") handleImages() - logger("----------------HANDLE END----------------") } else { logger("event not added!") }