View Issue Details

IDProjectCategoryView StatusLast Update
0011558mantisbtemailpublic2021-01-17 04:38
Reporterecaplan Assigned To 
Status newResolutionopen 
Product Version1.2.0 
Summary0011558: email_send applies "bug tag" processing without asking

The email_send() function in core/email_api.php processes "bug tags" without regard to whether I (the caller) want it to or not. Better, I would like to have a way to prevent specific "#n" strings from being treated as bug tags, while still processing other instances of #n as bug tags.

The real work is done in string_process_bug_link() in core/string_api.php

Steps To Reproduce

This is a problem for me in instances like this:

$t_email_data.body = "I'm 0000001! See Bug #1234";

Here, "0000001" should NOT be expanded as a bug tag, but "#1234" should. How about an escape character "#" -- e.g. "I'm #0000001!" -- which would treat the convert "##" to a single "#" and not expand it? Thus:

$t_email_data.body = "I'm #0000001! See Bug #1234";





2010-02-25 11:39

reporter   ~0024526

Here's an irony. The example bug tags in my submitted ticket were replaced when I didn't want them to. And the email I received from confirming my submission had them replaced as well:

$t_email_data.body = "I'm! See Bug";



2010-02-26 06:03

reporter   ~0024534

the pattern triggering links is customizable with $g_bug_link_tag. The default is:

$g_bug_link_tag = '#';

but you can use something else and avoid the issue.

For the records, I think using # as default is not a good idea and we should change it, but first we need to create some admin utility to convert existing bug tags to the new format.



2010-02-26 07:25

reporter   ~0024538

I'd think the default would have to be some string unlikely to appear in any other context, e.g: [BUGLINK:1234]

Even then, it will come up that somebody will want "[BUGLINK:1234]" to not be expanded.... like in this note. So an override/quote would be useful.

Thanks for your attention to this!



2010-02-26 10:25

reporter   ~0024546

While you attend to this, something similar should be done for:

$b_bugnote_link_tag = '~';

Thank you