Commit 58e9c3655248914b1b6a0b3b68fcc4ccfafd73b7

Authored by Antonio Terceiro
1 parent 915f2250

Refuse unexisting theme via GET parameter

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
app/helpers/application_helper.rb
... ... @@ -340,7 +340,7 @@ module ApplicationHelper
340 340 if ENV['RAILS_ENV'] == 'development' && environment.theme == 'random'
341 341 @random_theme ||= Dir.glob('public/designs/themes/*').map { |f| File.basename(f) }.rand
342 342 @random_theme
343   - elsif ENV['RAILS_ENV'] == 'development' && params[:theme]
  343 + elsif ENV['RAILS_ENV'] == 'development' && params[:theme] && File.exists?(File.join(Rails.root, 'public/designs/themes', params[:theme]))
344 344 params[:theme]
345 345 else
346 346 if profile && !profile.theme.nil?
... ...