Skip to content

Instantly share code, notes, and snippets.

@ozzyaaron
Created November 8, 2011 04:04
Show Gist options
  • Save ozzyaaron/1346970 to your computer and use it in GitHub Desktop.
Save ozzyaaron/1346970 to your computer and use it in GitHub Desktop.
def process_params_sort_key
# Remove the sort if someone is trying to forge it...
if params[:sort] && params[:sort].match(/(drop|=|--|;|'|")/)
debugger
send_exceptional(StandardError.new("Angelina Jolie in the house..."), "Params hacking detected")
params.delete(:sort)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment