Permalink
Browse files

updated comment handling

  • Loading branch information...
1 parent 3b5124d commit 022027ac5fe5c5629ee60eb698408c24fb0a8a14 @yogthos committed Oct 9, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/yuggoth/views/comments.clj
@@ -67,14 +67,19 @@
(defpage [:post "/comment"] {:keys [blogid captcha content author]}
(let [admin (session/get :admin)
- author (or (:handle admin) author)]
+ author (or (:handle admin) author)]
(if (and (or admin
(and (= captcha (:text (session/get :captcha)))
(not-empty author)))
(not-empty content))
+
(do
(db/add-comment blogid
- (string/replace (escape-html content) #"\n>" "\n>")
+ (string/replace
+ (.. (as-str content)
+ (replace "<" "&lt;")
+ (replace ">" "&gt;"))
+ #"\n&gt;" "\n>")
(cond
admin author

0 comments on commit 022027a

Please sign in to comment.