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 end
def get_target(link) def get_target(link)
link = link.split("?").first if link.nil?
temp_url = URI.parse(link) link = link.split("?").first
target = "_blank" temp_url = URI.parse(link)
if temp_url.host.nil? target = "_blank"
target = "_self" if temp_url.host.nil?
target = "_self"
end
end end
target target
end end