Page MenuHomePhabricator

Inconsistent use of UserActivity's item fields
Open, Needs TriagePublic


In the UserActivity class, several methods fill the activity items in an inconsistent way.

The comment item is supposed to be a comment, but sometimes it's being used to store a user name (the target user name in a relation, gift or user board message), which is a mess:

  • When used to store a user name, the user name is not htmlencoded. When it's used as a comment, it's htmlencoded. Frankly this is insane but "kinda" works because SocialProfile is almost never encoding things (inminent patch incoming). Ideally it shouldn't encode anything, this should be left to the view.
  • Please, if you need to store an additional user name somewhere, don't be lazy and create a new item for that and don't reuse something that has nothing to do with this!

The namespace item is used on gifts to store the gift id! In other activity types it seems to be used as a namespace.

Event Timeline

Restricted Application added a project: Social-Tools. · View Herald TranscriptAug 21 2018, 5:32 PM
Ciencia_Al_Poder renamed this task from Inconsistent html encoding in UserActivity's comment to Inconsistent use of UserActivity's item fields.Aug 21 2018, 5:51 PM
Ciencia_Al_Poder updated the task description. (Show Details)