Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent eval things from happening #24

Merged
merged 1 commit into from Mar 27, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/generators/letsrate/templates/rater_controller.rb
Expand Up @@ -2,7 +2,7 @@ class RaterController < ApplicationController


def create def create
if current_user.present? if current_user.present?
obj = eval "#{params[:klass]}.find(#{params[:id]})" obj = params[:klass].classify.constantize.find(params[:id])
if params[:dimension].present? if params[:dimension].present?
obj.rate params[:score].to_i, current_user.id, "#{params[:dimension]}" obj.rate params[:score].to_i, current_user.id, "#{params[:dimension]}"
else else
Expand Down