Opened 15 years ago
Closed 14 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)
Change History (15)
#3
@
14 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.
#6
@
14 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
@
14 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
@
14 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.
#10
@
14 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"
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.