1
4

1 回答 1

2

方法 #1 破解 Mantis 配置

把它放在你的config_inc.php中。将“a”添加到有效标签列表中应该可以解决您的问题:

   ############################
   # Mantis HTML Settings
   ############################

   # --- html tags -------------------

   # Set this flag to automatically convert www URLs and
   # email adresses into clickable links
   $g_html_make_links      = ON;

   # These are the valid html tags for multi-line fields (e.g. description)
   # do NOT include href or img tags here
   # do NOT include tags that have parameters (eg. <font face="arial">)
   $g_html_valid_tags      = 'p, li, ul, ol, br, pre, i, b, u, em';

   # These are the valid html tags for single line fields (e.g. issue summary).
   # do NOT include href or img tags here
   # do NOT include tags that have parameters (eg. <font face="arial">)
   $g_html_valid_tags_single_line      = 'i, b, u, em';

注意:配置文件建议不要添加 'href' 或 'img' 标签(可能是因为这些标签允许用户执行任意 javascript - 为跨站点脚本攻击打开了大门)!但是一个愚蠢的配置文件知道什么,对吧?

方法 #2 安装一个BBCode插件

再三考虑,最好获取一个实现您想要的功能的插件。我找到了两个 BBCode 插件,它们应该适用于当前的 Mantis 版本(我认为是 v1.1+)。看看这个这个

然后,您应该能够生成普通链接和命名链接,如下所示:
[url]http://www.bbcode.org/[/url]
[url=http://www.bbcode.org/]This be bbcode.org![/url]

于 2012-08-16T17:38:59.447 回答