Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 1 contributor
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/docphoto/core.clj
View
10 src/docphoto/core.clj
@@ -307,7 +307,7 @@
(deflinks
(application-link [application-id] "application" application-id)
- (user-applications-link [username] "user" "applications" username)
+ (user-applications-link [username] "user" "applications" (ring-codec/url-encode username))
(cv-link [application-id] "cv" application-id)
(profile-update-link [user-id] "profile" user-id)
(image-link [image-id scale filename] "image" image-id scale (ring-codec/url-encode filename))
@@ -1060,6 +1060,10 @@
(file base-image-path scale-type)
width height)))))
+(defn normalize-image-filename [filename]
+ (apply str (filter #(or (Character/isLetterOrDigit %) (#{\- \_ \.} %))
+ filename)))
+
(defn app-upload-image [request application]
(let [[filename content-type tempfile] ((juxt
:filename :content-type :tempfile)
@@ -1069,7 +1073,7 @@
order (-> (query-images application-id)
count inc double)
image-id (create-image
- {:filename__c filename
+ {:filename__c (normalize-image-filename filename)
:mime_type__c content-type
:exhibit_application__c application-id
:order__c order})]
@@ -1614,7 +1618,7 @@
(GET "/user/applications" [] current-user-applications-view)
(GET "/user/applications/:username" [username :as request]
- (user-applications-view request username))
+ (user-applications-view request (ring-codec/url-decode username)))
(context
"/admin" []

No commit comments for this range

Something went wrong with that request. Please try again.