mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Redirect to /over18 for NSFW links posted in SFW subreddits
Fix a bug where some NSFW links were not prompting the over 18 confirmation. Affects links marked as NSFW but posted to SFW subreddits
This commit is contained in:
@@ -252,6 +252,10 @@ class FrontController(RedditController):
|
||||
if not can_view_link_comments(article):
|
||||
abort(403, 'forbidden')
|
||||
|
||||
# check over 18
|
||||
if article.is_nsfw and not c.over18 and c.render_style == 'html':
|
||||
return self.intermediate_redirect("/over18", sr_path=False)
|
||||
|
||||
# Determine if we should show the embed link for comments
|
||||
c.can_embed = feature.is_enabled("comment_embeds") and bool(comment)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user