# Bug 博客：“LastPosted”泄露用户非公开数据，被利用以获取优势

**URL:** <https://meta.discourse.org/t/bug-blog-lastposted-reveals-non-public-data-about-users-exploited-to-gain-advantages/102280>\
**Category:** Feature\
**Created:** [2018 年11 月 18 日 20:44 UTC](https://meta.discourse.org/t/bug-blog-lastposted-reveals-non-public-data-about-users-exploited-to-gain-advantages/102280 "2018-11-18T20:44:42Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

作者： ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
发布日期： [2018 年11 月 19 日 02:03 UTC](https://meta.discourse.org/t/bug-blog-lastposted-reveals-non-public-data-about-users-exploited-to-gain-advantages/102280/4 "2018-11-19T02:03:40Z")

</div>

> [@Wintermute](#):
>
> Should I take your post to mean that you guys prefer to update `last_posted_at` after a private message?

Yes we prefer the default to be “last time you posted anything to anyone in the forum”, we don’t think it should imply “last time you posted something in a public category visible to all people on the forum”

I worry changing this will cause wide spread confusion, I do not really want to touch this in core. Private categories mean that going down this rats nest means we will need different visible last\_posted\_at per user, this is just way too complex for almost no gain.

To amend this you are going to need a plugin that strategically disables:

> <https://github.com/discourse/discourse/blob/c10bc4012a1205e82b13db5501df68dee76d1bcc/lib/post_creator.rb#L508-L508>

I guess a plugin with this source will do the trick for you

```plaintext
require_dependency 'post_creator'
module MyHack
   def update_user_counts
      super
      @user.update_attributes(last_posted_at: Time.new('2000-01-01'))
   end
end

class PostCreator
   prepend MyHack
end

```

---

_[View the full topic](https://meta.discourse.org/t/bug-blog-lastposted-reveals-non-public-data-about-users-exploited-to-gain-advantages/102280)._
