myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2802] trunk/app/controllers/feedback_controller.


From: noreply
Subject: [myexperiment-hackers] [2802] trunk/app/controllers/feedback_controller.rb: Minor fix to catch unguarded use of strings that was causing a stack error when
Date: Mon, 14 Nov 2011 08:51:50 -0500 (EST)

Revision
2802
Author
dtm
Date
2011-11-14 08:51:50 -0500 (Mon, 14 Nov 2011)

Log Message

Minor fix to catch unguarded use of strings that was causing a stack error when
they werent in params[].

Modified Paths

Diff

Modified: trunk/app/controllers/feedback_controller.rb (2801 => 2802)


--- trunk/app/controllers/feedback_controller.rb	2011-11-10 15:23:19 UTC (rev 2801)
+++ trunk/app/controllers/feedback_controller.rb	2011-11-14 13:51:50 UTC (rev 2802)
@@ -23,7 +23,7 @@
     else
       if captcha_valid?(params[:feedback][:captcha_id], params[:feedback][:captcha_validation])
     
-        from_user = params[:from] + ' (' + (!params[:email].blank? ? params[:email] : 'no email') + ')';
+        from_user = ( params[:from].blank? ? 'no from': params[:from] ) + ' (' + (!params[:email].blank? ? params[:email] : 'no email') + ')';
         Mailer.deliver_feedback(from_user, params[:subject], params[:content])
     
         respond_to do |format|
@@ -33,7 +33,7 @@
       else
         respond_to do |format|
           flash[:error] = 'Your feedback has not been submitted. CAPTCHA was not entered correctly.'
-          format.html { redirect_to "/feedback?from="+params[:from]+"&email="+params[:email]+"&subject="+params[:subject]+"&content="+params[:content] }
+          format.html { redirect_to "/feedback?from="+String(params[:from])+"&email="+String(params[:email])+"&subject="+String(params[:subject])+"&content="+String(params[:content]) }
         end
       end
     end

reply via email to

[Prev in Thread] Current Thread [Next in Thread]