Description
In Rails 2.3.2, when a blank parameter is sent in a request, the params[:parameter] is now set to nil instead of the empty string "". When a new user or event is created without an image or document, the corresponding checks evaluate to true, resulting in the processing on a new image or document. An exception is then thrown from this processing and is caught by the controller resulting in failure.
Patch is as follows (made on 0.1:
Index: users_controller.rb
===================================================================
— users_controller.rb (revision 776860)
+++ users_controller.rb (working copy)
@@ -223,7 +223,7 @@
private ###################################################
def new_image?
- return (params[:user_image] == '') ? false : true
+ return !(params[:user_image].blank?)
end
def invites_for_friend_links(user)
Index: events_controller.rb
===================================================================
— events_controller.rb (revision 776860)
+++ events_controller.rb (working copy)
@@ -327,11 +327,11 @@
end
def new_image?
- return (params[:event_image] == '') ? false : true
+ return !(params[:event_image].blank?)
end
def new_document?
- return (params[:event_document] == '') ? false : true
+ return !(params[:event_document].blank?)
end
def attendee_list(event, max)