diff --git a/r2/r2/controllers/front.py b/r2/r2/controllers/front.py index ab2590fd0..634ab7907 100644 --- a/r2/r2/controllers/front.py +++ b/r2/r2/controllers/front.py @@ -367,7 +367,7 @@ class FrontController(RedditController): num, t, spane = self._search(q, num = num, after = after, reverse = reverse, count = count) - if not isinstance(c.site,FakeSubreddit): + if not isinstance(c.site,FakeSubreddit) and not c.cname: all_reddits_link = "%s/search%s" % (subreddit.All.path, query_string({'q': query})) d = {'reddit_name': c.site.name, diff --git a/r2/r2/public/static/reddit_piece.js b/r2/r2/public/static/reddit_piece.js index 40f88cfec..c8d386422 100644 --- a/r2/r2/public/static/reddit_piece.js +++ b/r2/r2/public/static/reddit_piece.js @@ -53,7 +53,15 @@ function hover_open_menu(menu) { var global_cookies_allowed = true; function init() { - if(cur_domain != ajax_domain) { + /* temp strip off port for the ajax domain (which will need it to + * make a request) */ + var i = ajax_domain.indexOf(':'); + var a = (i < 0) ? ajax_domain : ajax_domain.slice(0, i); + /* permanently strip it off for the cur_domain which only sets cookies */ + i = cur_domain.indexOf(':'); + cur_domain = (i < 0) ? cur_domain : cur_domain.slice(0, i); + + if(cur_domain != a) { global_cookies_allowed = false; } else if(cnameframe && !logged) { diff --git a/r2/r2/templates/base.html b/r2/r2/templates/base.html index 29c5ed2a3..ec22e35ff 100644 --- a/r2/r2/templates/base.html +++ b/r2/r2/templates/base.html @@ -46,10 +46,11 @@ var logged = ${c.user_is_loggedin and ("'%s'" % c.user.name) or "false"}; var post_site = "${c.site.name if not c.default_sr else ''}"; - var cnameframe = ${'true' if c.cname else 'false'}; + var cnameframe = ${"true" if (c.cname and not c.authorized_cname) else "false"}; var modhash = ${"'%s'" % c.modhash or "false"}; var cur_domain = "${get_domain(cname = True, subreddit = False) if c.frameless_cname else g.domain}"; var ajax_domain = "${get_domain(cname = True, subreddit = False) if c.authorized_cname else g.domain}"; + diff --git a/r2/r2/templates/reddit.html b/r2/r2/templates/reddit.html index 6f46ad8e9..603a9724b 100644 --- a/r2/r2/templates/reddit.html +++ b/r2/r2/templates/reddit.html @@ -116,8 +116,8 @@ %endif %if thing.content: -
- + ## + ##