When a post is in modal view, clicking on the "r/[subreddit]" link generates a 404. This appears to be because the links are relative to the current location, this producing strange URL paths e.g.:
From a modal on a search page: "/search/r/pathofexile/hot" instead of "/r/pathofexile/hot"
From a modal on a subreddit page: "/r/EarthPorn/hot/r/EarthPorn/hot" instead of "/r/EarthPorn/hot"
Description
When a post is in modal view, clicking on the "r/[subreddit]" link generates a 404. This appears to be because the links are relative to the current location, this producing strange URL paths e.g.: