Post code on note does't escape '<', '>' !

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
blueray2048
Posts: 16
Joined: 04 Oct 2006, 08:48

Post code on note does't escape '<', '>' !

Post by blueray2048 »

when issue note contain html element. It does't escape and treated it as normal html element and render it.

Do this be the normal ?

Such as,

Initial Code

Code: Select all

    $t_code_ary = explode('<br />', $t_str_code);
    if (sizeof($t_code_ary))
    {
It displayed as

Code: Select all

    $t_code_ary = explode('
', $t_str_code);
    if (sizeof($t_code_ary))
    {
Thanks,
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Post by deboutv »

There is a list of acceptable html tag. <br> is in the list so if you write <br> in your description, it is interpreted as HTML tag.
Use the tag <pre></pre> to insert HTML code (or other code like PHP).
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
blueray2048
Posts: 16
Joined: 04 Oct 2006, 08:48

Post by blueray2048 »

Thanks, deboutv.

Yes, I have do this already.

before and after the code

Code: Select all

<pre>
    $t_code_ary = explode('
', $t_str_code);
    if (sizeof($t_code_ary))
    {

</pre>
But this does't help.
I go to turn the br element off instead.
Be this with config_inc.php ?
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Post by deboutv »

blueray2048 wrote:Thanks, deboutv.

Yes, I have do this already.

before and after the code

Code: Select all

<pre>
    $t_code_ary = explode('
', $t_str_code);
    if (sizeof($t_code_ary))
    {

</pre>
But this does't help.
I go to turn the br element off instead.
Be this with config_inc.php ?
Yes, modify the value of

Code: Select all

$g_html_valid_tags		= 'p, li, ul, ol, br, pre, i, b, u';
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
blueray2048
Posts: 16
Joined: 04 Oct 2006, 08:48

Post by blueray2048 »

Oh, Thanks deboutv,

It works now. But this may be added support bbcode should be much better.
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Post by deboutv »

Check in the bugtracker, I think it has already been asked. If not, feel free to ask it ;)
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
deboutv
Posts: 507
Joined: 15 Jan 2007, 14:31
Location: La Ciotat, FRANCE
Contact:

Post by deboutv »

Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/

Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
Post Reply