better params[:cms_path] adjustment

Oleg committed Sep 06, 2011
commit 266638cdb35802640157333d70639b667dc64e35
Showing 1 changed file with 3 additions and 1 deletions
app/controllers/cms_content_controller.rb +3 -1
@@ @@ -42,7 +42,9 @@ protected
end
if @cms_site
- params[:cms_path].to_s.gsub!(/^#{@cms_site.path}/, '').gsub!(/^\//, '')
+ if params[:cms_path].present?
+ params[:cms_path].gsub!(/^#{@cms_site.path}/, '').gsub!(/^\//, '')
+ end
I18n.locale = @cms_site.locale
else
I18n.locale = I18n.default_locale