Vote #78640
完了User link syntax (user:login) doesn't work for logins consisting of an email adress
0%
説明
From #4179#note-69:
Vu Anh wrote:
Seem it isn't working well with syntax "@user:abc@example.com@" (Login name contain "@" character)
I am able to confirm this issue. Important to note though, is that the short syntax (@login
) works as it should.
I'll attach a patch which adds explicit test coverage for this issue. It showcases what works and, after re-enabling the commented-out assertions, what currently fails.
Patch and confirmation against source:/trunk@16479 (though it is present on 3.4.1 too).
Environment:
Environment: Redmine version 3.4.0.devel@r16479 Ruby version 2.3.3-p222 (2016-11-21) [x86_64-linux] Rails version 4.2.8 Environment production Database adapter Mysql2 SCM: Subversion 1.8.8 Git 1.9.1 Filesystem Redmine plugins: no plugin installed
journals
--------------------------------------------------------------------------------
Thanks Mischa for opening this issue. I've already started work to a fix, but I found another issue (user logins with non alphanumeric characters like john.smith@foo.bar) on textile formatting and I need more time to fix all these issue. Unfortunately, only next week I'll have the time to continue work on this.
--------------------------------------------------------------------------------
The attached patch fixes both issues.
Because I couldn't modify the regex to ignore the emails that starts with "@" or "user:", I chose to use the same logic from markdown formatting also for textile.
@Mischa, when I've implemented this feature, I didn't take into consideration the format *user:"abcd@example.com"*.
@Jean-Philippe Lang, do you think that it'll be better to use the new method "restore_user_links!" also in the markdown/formatting.rb in order to avoid the almost duplicated regexes?
--------------------------------------------------------------------------------
The patch attached in #26443#note-3 fixes this issue properly on the current trunk and 3.4-stable.
Setting target version to 3.4.3.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> @Jean-Philippe Lang, do you think that it'll be better to use the new method "restore_user_links!" also in the markdown/formatting.rb in order to avoid the almost duplicated regexes?
That would be nice indeed if we can use the same method.
--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> That would be nice indeed if we can use the same method.
Here it is the new patch. I chose to move all the restore redmine links from markdown to the new method because I do not see any side effect.
I'll add a new patch soon that improves the existing tests in order to be sure that all redmine links work on each text formatting (none, textile, markdown).
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Attached the correct patch. The previous one has an undesired change.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Just a technical note: An interesting approach is the "html-pipeline":https://github.com/jch/html-pipeline used by GitHub which easily allows you to apply different filters or transformations over the initial html. I like that the implementation looks very clean. Jean-Philippe Lang, do you find this approach interesting for a future implementation in Redmine? I can work on this, but I want a validation first :)
--------------------------------------------------------------------------------
Changes are rather large, setting target to a major version.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Updated the patch to apply cleanly against current trunk (r17286).
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Patch committed, thanks Marius.
Marius BALTEANU wrote:
> Just a technical note: An interesting approach is the "html-pipeline":https://github.com/jch/html-pipeline used by GitHub which easily allows you to apply different filters or transformations over the initial html. I like that the implementation looks very clean. Jean-Philippe Lang, do you find this approach interesting for a future implementation in Redmine? I can work on this, but I want a validation first :)
It looks very interesting indeed. That would be nice to see how we could benefit to using it.
--------------------------------------------------------------------------------
related_issues
relates,Closed,4179,Link to user in wiki syntax
blocks,Closed,26507,"attachment:filename" link syntax would not work if the file name contains "@"
blocks,Closed,26892,Link to user in wiki syntax only works when login is written in lower case