hashobject / perun

Programmable static site generator built with Clojure and Boot (HELP NEEDED!)
https://perun.io
Eclipse Public License 1.0
350 stars 38 forks source link

re-pattern usage #184

Closed martinklepsch closed 6 years ago

martinklepsch commented 7 years ago

In some places re-pattern is used with strings that represent directories. As long as the directories don't contain any special characters it's fine but if they for example are set to "." unexpected stuff might happen.

(let [match-doc-root (re-pattern (str "^" doc-root))]
  (-> path
      (string/replace match-doc-root "")
bhagany commented 7 years ago

Good point. It should be relatively easy to escape those strings.