View Issue Details

IDProjectCategoryView StatusLast Update
0004525mantisbtcustomizationpublic2004-12-11 03:01
Reporterryandesign Assigned Tograngeway  
PrioritynormalSeveritytweakReproducibilityalways
Status closedResolutionfixed 
Product Version0.19.0 
Fixed in Version0.19.2 
Summary0004525: $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.

TagsNo 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 = '';
 
preg-quote.patch (560 bytes)   

Activities

ryandesign

ryandesign

2004-11-05 11:50

reporter   ~0008253

Perhaps you could consider including the attached patch in the next version of Mantis?

grangeway

grangeway

2004-11-06 12:52

reporter   ~0008258

This issue is now fixed in CVS

Thanks