Mercurial > zeropaste
diff app/controllers/pastes_controller.rb @ 240:16251b94eb6c
Whoops, forgot to secure the "new paste based on ##"
author | edogawaconan <me@myconan.net> |
---|---|
date | Mon, 07 Oct 2013 13:14:37 +0900 |
parents | 388504e43bcf |
children | 6cca1ab53337 |
line wrap: on
line diff
--- a/app/controllers/pastes_controller.rb Mon Oct 07 12:53:21 2013 +0900 +++ b/app/controllers/pastes_controller.rb Mon Oct 07 13:14:37 2013 +0900 @@ -18,10 +18,7 @@ def new @paste = Paste.new @paste.set_paste_key - begin - @paste.paste = Paste.find(params[:base]).paste - rescue - end + @paste.paste = Paste.safe_find(params[:base]).try(:paste) respond_to do |format| format.html # new.html.erb