This is a robust approach to making controller/{conference_name}/* case insensitive. Richard reported this issue in regards to West2026 flyer.
This commit is contained in:
@@ -9,7 +9,7 @@ class AdministrationController < ApplicationController
|
||||
|
||||
def edit
|
||||
return do_404 unless logged_in? && current_user.administrator?
|
||||
@this_conference = Conference.find_by!(slug: params[:slug])
|
||||
@this_conference = Conference.find_by!("LOWER(slug) = LOWER(?)", params[:slug])
|
||||
@page_title = 'articles.conferences.headings.edit'
|
||||
@main_title_vars = { vars: { title: @this_conference.title } }
|
||||
render 'new'
|
||||
|
||||
@@ -123,7 +123,7 @@ class ApplicationController < BaseController
|
||||
@page_title ||= 'page_titles.403.Please_Check_Email'
|
||||
|
||||
if (request.present? && request.referrer.present? && conference = /^\/conferences\/(\w+)\/register\/?$/.match(request.referrer.gsub(/^https?:\/\/.*?\//, '/')))
|
||||
@this_conference = Conference.find_by!(slug: conference[1])
|
||||
@this_conference = Conference.find_by!("LOWER(slug) = LOWER(?)", conference[1])
|
||||
@banner_image = @this_conference.cover_url
|
||||
template = 'conferences/email_confirm'
|
||||
end
|
||||
@@ -283,7 +283,7 @@ class ApplicationController < BaseController
|
||||
@page_title ||= 'page_titles.403.Please_Check_Email'
|
||||
|
||||
if (request.present? && request.referrer.present? && conference = /^\/conferences\/(\w+)\/register\/?$/.match(request.referrer.gsub(/^https?:\/\/.*?\//, '/')))
|
||||
@this_conference = Conference.find_by!(slug: conference[1])
|
||||
@this_conference = Conference.find_by!("LOWER(slug) = LOWER(?)", conference[1])
|
||||
@banner_image = @this_conference.cover_url
|
||||
template = 'conferences/email_confirm'
|
||||
end
|
||||
@@ -617,7 +617,7 @@ class ApplicationController < BaseController
|
||||
|
||||
protected
|
||||
def set_conference
|
||||
@this_conference = Conference.find_by!(slug: params[:slug])
|
||||
@this_conference = Conference.find_by!("LOWER(slug) = LOWER(?)", params[:slug])
|
||||
end
|
||||
|
||||
def set_conference_registration
|
||||
|
||||
@@ -76,7 +76,7 @@ class ConferenceAdministrationController < ApplicationController
|
||||
|
||||
def previous_stats
|
||||
set_conference
|
||||
conference = Conference.find_by_slug(params[:conference_slug])
|
||||
conference = Conference.find_by("LOWER(slug) = LOWER(?)", params[:conference_slug])
|
||||
return do_403 unless conference.is_public
|
||||
get_stats(false, nil, conference)
|
||||
logger.info "Generating #{conference.slug}.xls"
|
||||
|
||||
Reference in New Issue
Block a user