restrict some characters in meeting name

This commit is contained in:
Zachary Chai 2017-03-26 15:06:10 -04:00
parent ae916de296
commit 280b28742d
2 changed files with 7 additions and 2 deletions

View File

@ -22,13 +22,15 @@ class LandingController < ApplicationController
def resource
if params[:id].size > meeting_name_limit
redirect_to action: :index
redirect_to root_url, flash: {danger: t('meeting_name_long')}
elsif ['&', '$', ','].any? { |c| params[:id].include?(c) } # temporary fix for misbehaving characters
redirect_to root_url, flash: {danger: t('disallowed_characters_msg')}
elsif params[:resource] == 'meetings' && !params[:room_id]
render_meeting
elsif params[:resource] == 'rooms'
render_room
else
redirect_to root_url, flash: {danger: "An error occured"}
redirect_to root_url, flash: {danger: t('error')}
end
end

View File

@ -67,10 +67,12 @@ en-US:
copy_error: Use Ctrl-c to copy
create_your_session: Create your own meeting
date_recorded: Date
disallowed_characters_msg: Characters not allowed in meeting name $&,
duration: Length (minutes)
end: End
enter_name: Enter your name
enter_meeting_name: Enter a meeting name to start
error: An error occured
error_title: An error has occured
footer_html: Powered by %{bbb_link}
help: Help
@ -100,6 +102,7 @@ en-US:
body: "You have been invited by %{user} to a meeting.\n\nPlease open the following page in your web browser: &&URL&&"
subject: "%{user} invited you to a meeting"
moderator_default_message: Invitation link - %{url}
meeting_name_long: Meeting name too long
my_room: my room
name: Name
'no': 'No'