Skip to content

Commit e58f37f

Browse files
committed
Merge pull request #1 from dsjoerg/master
fix document.domain issue with IP hostnames
2 parents 2a6661b + ae0821a commit e58f37f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
// Proxino.log("gg.js domain was " + document.domain);
22
// weird, was ggtracker.com even though script was served via CDN
3-
document.domain = /(\w+)(.\w+)?$/.exec(location.hostname)[0];
3+
if (location.hostname.match(/^[0-9.]*$/) == null) {
4+
// only set document.domain if our location is a hostname like ggtracker.com or
5+
// ggtracker.test. But if it's an IP address, dont bother.
6+
document.domain = /(\w+)(.\w+)?$/.exec(location.hostname)[0];
7+
}
48
// Proxino.log("now gg.js domain is " + document.domain);

app/views/players/show.html.erb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
<h2><a href="/players/<%= @identity.id %>/<%= @identity.name %>"><%= @identity.name %></a><span ng-show="<%= @prolevel %> > 0" class="djcloak icon icon-star-white-32"></span><!--<span class="tiny prolabel">PRO</span>--></h2>
1212
<div class="links">
1313
<%= link_to('bnet', @identity.profile_url, {:class => 'bnet'}) if @identity.profile_url.present? %>
14-
<%= link_to('sc2ranks', @identity.sc2ranks_url) if @identity.sc2ranks_url.present? %>
1514
<% if controller.superuser? %>
1615
<%= link_to('+1Month', :controller => :players, :action => :give_one_month_ggtracker_pro) %>
1716
<% end %>

0 commit comments

Comments
 (0)