changeset 53:817c54a72b58

Minor sanitation.
author Edho Arief <edho@myconan.net>
date Thu, 04 Oct 2012 04:36:49 +0700
parents 4c782f8d835b
children e8920b00035c
files app/controllers/pastes_controller.rb
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/app/controllers/pastes_controller.rb	Thu Oct 04 04:23:39 2012 +0700
+++ b/app/controllers/pastes_controller.rb	Thu Oct 04 04:36:49 2012 +0700
@@ -3,6 +3,11 @@
   # GET /pastes/1
   # GET /pastes/1.json
   def show
+    id = params[:id].to_i
+    if id.to_s != params[:id]
+      redirect_to paste_path(id)
+      return
+    end
     @paste = Paste.find(params[:id])
 
     respond_to do |format|