Defect #34894

User link using @ not working at the end of line

Added by Dmitry Makurin 2 months ago. Updated about 1 month ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Text formatting
Target version:4.1.3
Resolution:Fixed Affected version:4.1.0

Description

Redmine fails to parse mention like @jsmith. (with dot at the end)

At source:trunk/app/helpers/application_helper.rb#L1286 regex extracts full line with all extra sybmols like _-@. and thus can't fide a user with that login.

It only affects separator @, user:jsmith. or user#2. works fine.

Small patch with fix and test in attachment.

Fixes_user_mention_at_the_end_of_line_.patch Magnifier (1.53 KB) Dmitry Makurin , 2021-03-15 13:54

0001-Fix-user-mention-using-not-working-at-the-end-of-lin.patch Magnifier (1.64 KB) Marius BALTEANU, 2021-04-11 09:46

Associated revisions

Revision 20936
Added by Go MAEDA about 1 month ago

Fix user link using @ not working at the end of line (#34894).

Patch by Marius BALTEANU.

Revision 20942
Added by Go MAEDA about 1 month ago

Merged r20936 from trunk to 4.2-stable (#34894).

Revision 20943
Added by Go MAEDA about 1 month ago

Merged r20936 from trunk to 4.1-stable (#34894).

History

#1 Updated by Marius BALTEANU about 1 month ago

  • Assignee set to Marius BALTEANU

#2 Updated by Marius BALTEANU about 1 month ago

  • Status changed from New to Confirmed
  • Target version set to 4.1.3
  • Affected version set to 4.1.0

#3 Updated by Marius BALTEANU about 1 month ago

Dmitry, thanks for reporting and fixing this issue, it looks good to me with one mention: we don't need a new test for this case, it's enough to add this case at the existing test.

The patch passes all the tests: https://gitlab.com/redmine-org/redmine/-/pipelines/284519558

#4 Updated by Dmitry Makurin about 1 month ago

Marius BALTEANU wrote:

we don't need a new test for this case, it's enough to add this case at the existing test.

Just wanted to show the difference between other regexs in same situation. Initially only @ was a problem.

#5 Updated by Go MAEDA about 1 month ago

  • Subject changed from User mention at the end of line to user link using @ not working at the end of line
  • Category set to Text formatting
  • Status changed from Confirmed to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix. Thank you all for reporting and fixing the issue.

#6 Updated by Go MAEDA about 1 month ago

  • Status changed from Resolved to Closed

#7 Updated by Marius BALTEANU about 1 month ago

  • Subject changed from user link using @ not working at the end of line to User link using @ not working at the end of line

Also available in: Atom PDF