View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004525 | mantisbt | customization | public | 2004-09-13 04:17 | 2004-12-11 03:01 |
Reporter | ryandesign | Assigned To | grangeway | ||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 0.19.0 | ||||
Fixed in Version | 0.19.2 | ||||
Summary | 0004525: $g_bug_link_tag doesn't work when it contains "/" | ||||
Description | Mantis searches bug report texts for the # sign followed by numbers and converts this to a link to the bug with that number. This is configurable through the config setting $g_bug_link_tag. There is documentation suggesting that this can be changed to "bug://" and I liked this suggestion and wanted to implement it in my installation. Unfortunately strings containing "/" cannot be used for the bug link tag because of a bug in Mantis. The preg_quote() function is used improperly. The attachment preg-quote.patch fixes this against the 0.19.0 release. | ||||
Tags | No tags attached. | ||||
Attached Files | preg-quote.patch (560 bytes)
diff -r -u mantis-0.19.0/core/string_api.php mantis-0.19.0-preg-quote/core/string_api.php --- mantis-0.19.0/core/string_api.php Mon Sep 13 01:46:44 2004 +++ mantis-0.19.0-preg-quote/core/string_api.php Mon Sep 13 01:47:46 2004 @@ -175,7 +175,7 @@ $t_tag = config_get( 'bug_link_tag' ); $t_path = config_get( 'path' ); - preg_match_all( '/(^|.+?)(?:(?<=^|\W)' . preg_quote($t_tag) . '(\d+)|$)/s', + preg_match_all( '/(^|.+?)(?:(?<=^|\W)' . preg_quote($t_tag, '/') . '(\d+)|$)/s', $p_string, $t_matches, PREG_SET_ORDER ); $t_result = ''; | ||||