fix get_invite_link function. fixes #471
This commit is contained in:
parent
5dc32186e8
commit
e629a9bf71
1 changed files with 1 additions and 4 deletions
|
@ -64,9 +64,6 @@ private
|
|||
end
|
||||
|
||||
def get_invite_link
|
||||
unsafe_uri = request.env["REQUEST_URI"] || 'https://metamaps.cc'
|
||||
valid_url = /^https?:\/\/([\w\.-]+)(:\d{1,5})?\/?$/
|
||||
safe_uri = (unsafe_uri.match(valid_url)) ? unsafe_uri : '//metamaps.cc/'
|
||||
@invite_link = "#{safe_uri}join" + (current_user ? "?code=#{current_user.code}" : "")
|
||||
@invite_link = "#{request.base_url}/join" + (current_user ? "?code=#{current_user.code}" : "")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue