changeset 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 a8942fab1f34
children e413246bb589
files app/controllers/pastes_controller.rb
diffstat 1 files changed, 1 insertions(+), 4 deletions(-) [+]
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