html-escape path before parsing as pronoun string fixes #28

This commit is contained in:
Morgan Astra 2016-01-23 15:55:21 -08:00
parent d7c898afba
commit e5a03f5260
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,5 @@
#!/bin/sh #!/bin/sh
export port=$1 export PORT=6666
lein uberjar lein uberjar
open http://localhost:"$port"/ze/zir
java -cp target/pronouns-standalone.jar clojure.main -m pronouns.web java -cp target/pronouns-standalone.jar clojure.main -m pronouns.web

View File

@ -1,7 +1,8 @@
(ns pronouns.pages (ns pronouns.pages
(:require [clojure.string :as s] (:require [clojure.string :as s]
[pronouns.util :as u] [pronouns.util :as u]
[hiccup.core :refer :all])) [hiccup.core :refer :all]
[hiccup.util :refer [escape-html]]))
(defn wrap-pronoun (defn wrap-pronoun
[pronoun] [pronoun]
@ -121,7 +122,7 @@
"https://github.com/witch-house/pronoun.is/blob/master/resources/pronouns.tab")) "https://github.com/witch-house/pronoun.is/blob/master/resources/pronouns.tab"))
(defn pronouns [path pronouns-table] (defn pronouns [path pronouns-table]
(let [pronouns (parse-pronouns-with-lookup path pronouns-table)] (let [pronouns (parse-pronouns-with-lookup (escape-html path) pronouns-table)]
(if pronouns (if pronouns
(apply format-pronoun-examples pronouns) (apply format-pronoun-examples pronouns)
(not-found)))) (not-found))))