aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/user_controller.rb
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-07-20 01:37:39 +0100
committerFrancis Irving <francis@mysociety.org>2010-07-20 01:37:39 +0100
commit693cee1d548934af17a9f71afcdc2d05568794a9 (patch)
tree423931a11cd83e9656140625ea15d54d31178eaa /app/controllers/user_controller.rb
parent847f5a84e296b44ee12ed4185c63559217f8257e (diff)
Clear profile photo only in POST
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r--app/controllers/user_controller.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index 854c0d989..e2bfa7da9 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -399,6 +399,10 @@ class UserController < ApplicationController
end
def clear_profile_photo
+ if !request.post?
+ raise "Can only clear profile photo from POST request"
+ end
+
# check they are logged in (the upload photo option is anyway only available when logged in)
if authenticated_user.nil?
flash[:error] = "You need to be logged in to clear your profile photo."