Index: core/string_api.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/string_api.php,v
retrieving revision 1.40
diff -u -r1.40 string_api.php
--- core/string_api.php 24 Aug 2003 02:59:56 -0000 1.40
+++ core/string_api.php 7 Jan 2004 06:54:34 -0000
@@ -38,7 +38,8 @@
$p_string = string_insert_hrefs( $p_string );
$p_string = string_process_bug_link( $p_string );
$p_string = string_process_cvs_link( $p_string );
-
+ $p_string = string_convert_bb_code( $p_string );
+
return $p_string;
}
@@ -101,6 +102,45 @@
$t_replace_with,
$p_string );
}
+
+ # --------------------
+ # Process the $p_string and add BB Code HTML.
+ function string_convert_bb_code ( $p_string ){
+ $t_html_allow_bb_code = config_get( 'html_allow_bb_code' );
+
+ if( ON !== $t_html_allow_bb_code ) {
+ return $p_string;
+ }
+
+ $t_regex = array(
+ "/\[b\](.*)\[\/b\]/siU",
+ "/\[i\](.*)\[\/i\]/siU",
+ "/\[u\](.*)\[\/u\]/siU",
+ "/\[s\](.*)\[\/s\]/siU",
+ "/.*<\/a>)/siU",
+ "/.*<\/a>)/siU",
+ "/.*<\/a>)/siU",
+ "/.*<\/a>)/siU",
+ "/.*<\/a>)/siU",
+ "/.*<\/a>)/siU",
+ "/.*<\/a>)/siU"
+ );
+ $t_replace = array(
+ "$1",
+ "$1",
+ "$1",
+ "$1",
+ "[.pdf]",
+ "[.doc]",
+ "[.xls]",
+ "[.avi]",
+ "[.zip]",
+ "[.ogg]",
+ "[.ppt]"
+ );
+ return preg_replace($t_regex,$t_replace,$p_string);
+ }
+
# --------------------
# Process $p_string, looking for bug ID references and creating bug view
Index: config_defaults_inc.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/config_defaults_inc.php,v
retrieving revision 1.130
diff -u -r1.130 config_defaults_inc.php
--- config_defaults_inc.php 1 Sep 2003 14:06:57 -0000 1.130
+++ config_defaults_inc.php 7 Jan 2004 06:54:35 -0000
@@ -538,6 +543,9 @@
# Set this flag to automatically convert www URLs and
# email adresses into clickable links
$g_html_make_links = ON;
+
+ # Set this flag to enable Simple BB Code Style Transformations
+ $g_html_allow_bb_code = ON;
# do NOT include href or img tags here
# do NOT include tags that have parameters (eg. )