Defect #31021

Fullwidth characters enclosed in "<" and ">" are removed in email notifications

Added by Masaomi Yoshida over 2 years ago. Updated over 2 years ago.

Status:ConfirmedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Email notifications
Target version:-
Resolution: Affected version:3.4.7

Description

Hi, I'm using Redmine ver.3.4.7 and multi-byte environment(Japanese).

I found a bug in mail notifications function.
When I update a ticket with the comments below

-----
aaa<bbb>ccc
AAA<BBB>CCC
-----

The less-than sign, grater-than sign, and multi-byte "BBB" are deleted in the mail, while the ticket itself is properly updated.
Note that the first sentence is written using single-byte characters, and the second one is written using multi-byte characters except less-than sign(<) and grater-than sign(>).

It will not happen when the letters are quoted with < pre > and < /pre >.
Neither It will not happen when html mail is not used.

See the attached for details.

Redmine_notification_mail.png (4.26 KB) Masaomi Yoshida, 2019-03-13 07:43

email-4.png (26.4 KB) Go MAEDA, 2019-03-13 07:58

0001-Remove-unnecessary-trailing-white-spaces.patch Magnifier (23.6 KB) Yuichi HARADA, 2019-03-28 05:18

0002-Fullwidth-characters-enclosed-in-lt-and-gt.patch Magnifier (1 KB) Yuichi HARADA, 2019-03-28 05:18

0003-Add-tests.patch Magnifier (2.17 KB) Yuichi HARADA, 2019-03-28 05:18

History

#1 Updated by Go MAEDA over 2 years ago

I cannot reproduce the problem in the current trunk (Redmine 4.0.2.devel.17938). I will check with 3.4 later.

#2 Updated by Masaomi Yoshida over 2 years ago

Maeda-san,
Thanks for prompt response and trying to reproduce.

I forgot saying this but if characters are all single-byte in < and >, the bug will not happen.
It happens only when the characters include multi-byte characters.

Please try using my sample in description section.

aaa<bbb>ccc
AAA<BBB>CCC

#3 Updated by Go MAEDA over 2 years ago

  • Status changed from New to Confirmed

Masaomi Yoshida wrote:

It happens only when the characters include multi-byte characters.

Thank you for pointing it out. I have confirmed that the issue is reproducible in the current trunk.

#4 Updated by Go MAEDA over 2 years ago

  • Subject changed from Letters/Words are deleted in mails when multi-byte characters are in less-than sign(<) and grater-than sign(>) to Fullwidth characters enclosed in "<" and ">" are removed in email notifications

#5 Updated by Yuichi HARADA over 2 years ago

Escape processing of "<" and ">" is performed by RedCloth3#escape_html_tags .
source:/trunk/lib/redmine/wiki_formatting/textile/redcloth3.rb#L1218

However, full-width characters could not be processed because they do not match the regular expression "\w".
Change the regular expression "\w" to "_" and "[[:alnum:]]" to match even full-width characters.

I attached the patches.

#6 Updated by Go MAEDA over 2 years ago

  • Target version set to Candidate for next minor release

#7 Updated by Go MAEDA over 2 years ago

I tested the patch and found that the problem still remains for strings such as "<###>" and "<あいうえお>".

#8 Updated by Go MAEDA over 2 years ago

  • Target version deleted (Candidate for next minor release)

Also available in: Atom PDF