From f386c3a4115071c4d0ee145466d7e4feda89a64d Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Wed, 16 Sep 2009 14:33:30 -0300 Subject: [PATCH] ActionItem1225: escape with CGI.escape --- app/controllers/public/profile_controller.rb | 2 +- app/controllers/public/search_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/public/profile_controller.rb b/app/controllers/public/profile_controller.rb index 43bc410..fb2d59f 100644 --- a/app/controllers/public/profile_controller.rb +++ b/app/controllers/public/profile_controller.rb @@ -19,7 +19,7 @@ class ProfileController < PublicController def tag @tag = params[:id] - @tag_cache_key = "tag_#{@tag.to_s.gsub(' ', '%20')}_#{profile.id.to_s}_page_#{params[:npage]}" + @tag_cache_key = "tag_#{CGI.escape(@tag.to_s)}_#{profile.id.to_s}_page_#{params[:npage]}" if is_cache_expired?(@tag_cache_key, true) @tagged = profile.find_tagged_with(@tag).paginate(:per_page => 20, :page => params[:npage]) end diff --git a/app/controllers/public/search_controller.rb b/app/controllers/public/search_controller.rb index 000c79d..6176344 100644 --- a/app/controllers/public/search_controller.rb +++ b/app/controllers/public/search_controller.rb @@ -230,7 +230,7 @@ class SearchController < PublicController def tag @tag = environment.tags.find_by_name(params[:tag]) - @tag_cache_key = "tag_#{@tag.to_s.gsub(' ', '%20')}_env_#{environment.id.to_s}_page_#{params[:npage]}" + @tag_cache_key = "tag_#{CGI.escape(@tag.to_s)}_env_#{environment.id.to_s}_page_#{params[:npage]}" if is_cache_expired?(@tag_cache_key, true) @tagged = environment.articles.find_tagged_with(@tag).paginate(:per_page => 10, :page => params[:npage]) end -- libgit2 0.21.2