Skip to content

Commit

Permalink
Don't leak selftext through the meta description on deleted posts
Browse files Browse the repository at this point in the history
Thanks to Anton Martynov for the report!
  • Loading branch information
JordanMilne committed May 15, 2015
1 parent 644f098 commit 5ffbff0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion r2/r2/lib/pages/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@ def __init__(self, link = None, comment = None,
params = {'title':_force_unicode(link_title), 'site' : c.site.name}
title = strings.link_info_title % params
short_description = None
if link and link.selftext:
if link and link.selftext and not (link._spam or link._deleted):
short_description = _truncate(link.selftext.strip(), MAX_DESCRIPTION_LENGTH)
# only modify the title if the comment/author are neither deleted nor spam
if comment and not comment._deleted and not comment._spam:
Expand Down

0 comments on commit 5ffbff0

Please sign in to comment.