Fix "possible unprotected redirect" warning (#10511)
* Fix "possible unprotected redirect" warning * Fix 'line too long' warning
This commit is contained in:
parent
183a672113
commit
e35f97cf37
2 changed files with 2 additions and 2 deletions
|
|
@ -174,7 +174,7 @@ class ChatChannelMembershipsController < ApplicationController
|
|||
invite_cache_key = "chat-channel-invite-#{@chat_channel.id}"
|
||||
invitation_slug = Rails.cache.read(invite_cache_key)
|
||||
existing_membership = ChatChannelMembership.find_by(user_id: current_user.id, chat_channel_id: @chat_channel.id)
|
||||
redirect_to "/connect/#{@chat_channel.slug}" if existing_membership && existing_membership.status == "active"
|
||||
redirect_to URI.parse("/connect/#{@chat_channel.slug}").path if existing_membership&.status == "active"
|
||||
@link_expired = true if invitation_slug != params[:invitation_slug]
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ class CommentsController < ApplicationController
|
|||
redirect_url = @comment.commentable&.path
|
||||
if redirect_url
|
||||
flash[:success] = "Comment was successfully deleted."
|
||||
redirect_to redirect_url
|
||||
redirect_to URI.parse(redirect_url).path
|
||||
else
|
||||
redirect_to_comment_path
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue