View Issue Details

IDProjectCategoryView StatusLast Update
0019606mantisbtemailpublic2016-08-15 09:02
ReporterkburkumAssigned Todregad 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformMantis Hub (Hosted)OSWindowsOS Version7
Product Version 
Target Version1.2.20Fixed in Version1.2.20 
Summary0019606: Numeric References Should Not Transpose Into URL Unless Number = Valid Issue Number
Description

See attached screen shot from an email notification. Numeric references in Mantis fields should not be transcribed into URL unless the number reference is an actual / valid Issue Number in Mantis. In the attached example, there was verbiage referencing the numbered list:

0000001
0000002
0000003

Anywhere those numbers were, the system transcribed those into Mantis issue URLs.

Side Note - PivotalTracker had a similar issue (we manage our user stories there). The added validation to ensure the number reference was an actual story ID (#) prior to transcribing it into a link that could be clicked.

TagsNo tags attached.

Activities

kburkum

kburkum

2015-04-09 12:05

reporter  

Example.jpg (103,378 bytes)
Example.jpg (103,378 bytes)
kburkum

kburkum

2015-04-09 12:07

reporter   ~0049371

Looks like it happened above in my Description when I typed the following with the # in front of the numbers...

1
2
3

vboctor

vboctor

2015-04-09 12:26

manager   ~0049373

In the above case the issues 1, 2, and 3 are valid issues and if you hover on them you will see the bubbles with the issue status/title. Are you saying that in your case the referenced issue numbers didn't exist? Or was there some other criteria that makes them valid/invalid?

kburkum

kburkum

2015-04-09 12:37

reporter  

Message.jpg (86,634 bytes)
Message.jpg (86,634 bytes)
kburkum

kburkum

2015-04-09 12:38

reporter   ~0049374

I attached an example of the message I receive when I click one of the hyperlinks (issue 0000001 to be specific). I validated that the issue number does not exist if I do a search for "1" in the search for the issue in the search box (upper right). Hope this helps.

dregad

dregad

2015-04-10 07:20

developer   ~0049375

This is reproducible in latest master.

In the GUI, Mantis does not generate links for invalid bug references, and leaves the text as-is (e.g. #999999).

So the problem is limited to notification e-mails; the formatting plugin calls string_process_bug_link(), and with the 2nd param ($p_include_anchor) set to false, the function unconditionally replaces the number by a link [1].

This code exists as is since 2004, and I'm not sure of the rationale for not doing the check in the first place (see the comment above [1]).

[1] https://github.com/mantisbt/mantisbt/blob/master/core/string_api.php#L365

dregad

dregad

2015-04-16 19:23

developer   ~0049427

Pull request https://github.com/mantisbt/mantisbt/pull/596

dregad

dregad

2015-04-29 08:50

developer   ~0050674

For the record, the master branch commit SHA referenced in (1.2.x) commit baaebb0d is incorrect, as I had to rebase master after pushing 1.2.x.

Related Changesets

MantisBT: master-1.2.x baaebb0d

2015-04-10 09:57:06

dregad

Details Diff
Don't create FQDN link when the bug doesn't exist

Backport from master a929e983cd2b8781f7c37613f6c7e6fa5c6ed0dc.

Fixes 0019606
mod - core/string_api.php Diff File

MantisBT: master f66d8981

2015-04-10 09:57:06

dregad

Details Diff
Don't create FQDN link when the bug doesn't exist

Fixes 0019606
mod - core/string_api.php Diff File

Issue History

Date Modified Username Field Change
2015-04-09 12:05 kburkum New Issue
2015-04-09 12:05 kburkum File Added: Example.jpg
2015-04-09 12:07 kburkum Note Added: 0049371
2015-04-09 12:26 vboctor Note Added: 0049373
2015-04-09 12:37 kburkum File Added: Message.jpg
2015-04-09 12:38 kburkum Note Added: 0049374
2015-04-10 07:20 dregad Status new => confirmed
2015-04-10 07:20 dregad Note Added: 0049375
2015-04-16 19:23 dregad Note Added: 0049427
2015-04-16 19:23 dregad Assigned To => dregad
2015-04-16 19:23 dregad Status confirmed => assigned
2015-04-16 19:23 dregad Target Version => 1.3.0-beta.3
2015-04-29 08:45 dregad Changeset attached => MantisBT master-1.2.x baaebb0d
2015-04-29 08:45 dregad Status assigned => resolved
2015-04-29 08:45 dregad Resolution open => fixed
2015-04-29 08:45 dregad Fixed in Version => 1.2.20
2015-04-29 08:45 dregad Changeset attached => MantisBT master f66d8981
2015-04-29 08:50 dregad Note Added: 0050674
2015-04-29 09:05 atrol Target Version 1.3.0-beta.3 => 1.2.20
2016-08-15 09:02 dregad Status resolved => closed