View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0037257 | mantisbt | ui | public | 2026-06-15 11:43 | 2026-06-18 07:55 |
| Reporter | raspopov | Assigned To | community | ||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | assigned | Resolution | open | ||
| Product Version | 1.3.0 | ||||
| Target Version | 2.28.4 | ||||
| Summary | 0037257: Incorrect identification of a non-default mention tag | ||||
| Description | The bug was discovered by scanning the source code with a custom utility designed to detect instances where variables were incorrectly included in strings, as was the case in 0037250. The mention_api.php file, line 81:
The interesting thing is that there are tests for this feature in MentionParsingTest.php, but the test doesn't cover this case, likely due to a typo in the test:
Most likely, the tag should be at the beginning of the line too, like this:
But the most interesting thing is that even if you fix the test, it will continue to return a false positive! This happens because the test uses the “@” character (by default), and this character is matched by another part of the regular expression | ||||
| Tags | No tags attached. | ||||
|
Fixed and added test. PR: https://github.com/mantisbt/mantisbt/pull/2232 |
|
|
Introduced by MantisBT master-1.3.x dc662052 |
|
|
MantisBT: master-1.3.x dc662052 2016-06-12 13:15 Damien Regad Details Diff |
Use specific regex for parsing mentions It turns out that the current $g_user_login_valid_regex pattern cannot be used as it allows spaces. Furthermore, special handling is required to process e-mail address-like strings. For this reason, a custom regex is built for the purpose of mentions parsing, supporting only a subset of the allowed usernames. Fixes 0021083 |
Affected Issues 0021083, 0037257 |
|
| mod - core/mention_api.php | Diff File | ||