Skip to:

Opened 13 years ago

Closed 12 years ago

#3721 closed defect (bug) (fixed)

Mentions do not work if there is a period after the username.

Reported by: lsparks's profile lsparks Owned by:
Milestone: 1.6 Priority: normal
Severity: normal Version:
Component: Activity Keywords: has-patch needs-testing


It appears that mentions do not work if there is a period directly after them.

Example: Hey, everyone say hi to @username.

I took a look at bp_activity_find_mentions() and it appears the expression used to allow usernames like @first.last includes the period all the time, so it incorrectly matches the actual punctuation period as part of the username when the name is at the end of a punctuated sentence. This causes an issue because the username with the period on the end is not technically correct and will not trigger any the notifications or highlighting.

I tried adding a word boundary to the end of the existing expression to get /[@]+([A-Za-z0-9-_.\@]+)\b/ and that seems to work in the limited testing I have done.

Change History (3)

#1 @boonebgorges
13 years ago

  • Keywords has-patch needs-testing added
  • Milestone changed from Awaiting Review to 1.6

#2 @boonebgorges
12 years ago

Note that this is only an issue if you've activated BP_ENABLE_USERNAME_COMPATIBILITY_MODE.

Patch looks good and tests clean. Thanks!

#3 @boonebgorges
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [5546]) Don't count word-ending periods when sniffing out at-mentions in bp_activity_find_mentions.
Fixes #3721
Props lsparks

Note: See TracTickets for help on using tickets.