fixed url target issue

This commit is contained in:
Harry Bomrah 2014-11-27 18:19:43 +08:00
parent 03822379b2
commit 179a14d717
1 changed files with 7 additions and 5 deletions

View File

@ -478,11 +478,13 @@ module ApplicationHelper
end
def get_target(link)
link = link.split("?").first
temp_url = URI.parse(link)
target = "_blank"
if temp_url.host.nil?
target = "_self"
if link.nil?
link = link.split("?").first
temp_url = URI.parse(link)
target = "_blank"
if temp_url.host.nil?
target = "_self"
end
end
target
end