Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 9 years ago

#2145 closed defect (bug) (fixed)

[patch] "@ mention" bugs

Reported by: snark Owned by:
Milestone: 1.5 Priority: major
Severity: Version:
Component: Activity Keywords:
Cc: snark, boonebgorges

Description

Here are 2 "@ mention" bugs I just found:

1) If the "@ mention" touches another character, like a comma ("@user,"), "@user" will still get hyperlinked, but it will not show up in that user's "@ mention" list

2) If you edit a Topic or Topic reply that already has an at mention, it will display the HTML in the editing window and when you post add another set of <a> tags around the link and keep doing this each time you edit, so after three edits each "@ mention" will be triple liked, like this:

<a href="xxx/url/"><a href="xxx/url/"><a href="xxx/url/">@user</a></a></a>

Attachments (2)

strip_tags_on_forum_edit_screens.patch (869 bytes) - added by boonebgorges 10 years ago.
BP - @mention bug.png (91.9 KB) - added by paulhastings0 9 years ago.
Screenshot of @mention bug

Download all attachments as: .zip

Change History (15)

#1 @snark
10 years ago

  • Cc snark added
  • Milestone set to 1.2.2

#2 @snark
10 years ago

Also: if you use an "@mention" in a private message, the "@username" is not hyperlinked to the user's profile. Yes, in this case, you don't want a private message "@mention" to show up under a user's Profile "@ mentions" tab, but it would be nice to have it just link to the user's profile. So if you send a private message and reference "@user", the recipient of the message can just click from the "@mention" to that user's profile.

#3 @boonebgorges
10 years ago

  • Cc boonebgorges added
  • Component set to Core
  • Keywords has-patch needs-testing added

snark's problem 1 worksforme on rev 2928. The mention filter only picks out alphanumeric characters, ignoring punctuation.

The attached patch addresses problem (2) by stripping tags on the content of the edit post boxes. It's a bit of a broad solution, but I figure it's OK since HTML is stripped on the original post and it seems like an accident that it's allowed here at all.

#4 @boonebgorges
10 years ago

  • Component changed from Core to Activity

#5 @paulhastings0
9 years ago

  • Summary changed from "@ mention" bugs to [patch] "@ mention" bugs

@paulhastings0
9 years ago

Screenshot of @mention bug

#6 @paulhastings0
9 years ago

I added a screenshot of the bug from tonight. As you can see the bug itself is not very consistent, sometimes showing up in different combinations.

http://trac.buddypress.org/attachment/ticket/2145/BP%20-%20%40mention%20bug.png

We're using BP 1.2.6, the BP-Slick theme (child theme of BP-Default) and WP 3.0.1.

#7 @DJPaul
9 years ago

  • Keywords has-patch needs-testing removed

Boone's patch works, but it also strips out <a> tags people enter directly into their posts. What about not running edited posts/content through the @generator function?

#8 @DJPaul
9 years ago

Paul's report is also accurate.

When you have a string such as "@admin1 @admin", it tries finding a username of "admin1" and then "@admin". If "@admin1" doesn't exist, it'll match "@admin" twice.

#9 @djpaul
9 years ago

(In [3340]) Change the "at name" filter to only replace whole-word matches. See #2145

#10 @DJPaul
9 years ago

[3340] switches the replacement to a preg_replace so we can use a boundary check to find the end of the matched username. This prevents "@admin1 @admin" being linked twice (on both "admin" strings) -- it should now only match on the second "@admin"

#11 @boonebgorges
9 years ago

(In [3474]) Adds filter that prevents embedded anchor tags for at-mentions in forum topic/post edit mode. References #2145

#12 @boonebgorges
9 years ago

Ping DJPaul - [3474] fixes problem 2 from the OP, does your patch fix problem (1)? Can this be closed?

#13 @DJPaul
9 years ago

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

Just tested and it works okay now. Closing as fixed.

Note: See TracTickets for help on using tickets.