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,12 +478,14 @@ module ApplicationHelper
end end
def get_target(link) def get_target(link)
if link.nil?
link = link.split("?").first link = link.split("?").first
temp_url = URI.parse(link) temp_url = URI.parse(link)
target = "_blank" target = "_blank"
if temp_url.host.nil? if temp_url.host.nil?
target = "_self" target = "_self"
end end
end
target target
end end