人们可以使用<a href="XX"> tag in mantis?</a>

时间:2012-08-16 14:04:37

标签: mantis

我想在MantisBT的某些字段中显示超链接,但我发现如果我使用<a href=..>标记,Mantis会直接显示网址:点击此处`

Mantis只是将URL显示为可点击链接,而不是文本点击此处可点击。

链接有效,但不是那么漂亮。有谁知道如何解决这个问题?

1 个答案:

答案 0 :(得分: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 +)。查看thisthis一个。

然后你应该能够像这样生成普通链接和命名链接:
[url]http://www.bbcode.org/[/url]
[url=http://www.bbcode.org/]This be bbcode.org![/url]

相关问题