View Issue Details

IDProjectCategoryView StatusLast Update
0016342mantisbtbugtrackerpublic2014-02-07 18:24
Reporterdwalczak Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.15 
Target Version1.2.16Fixed in Version1.2.16 
Summary0016342: The g_html_valid_tags_single_line configuration variable seems to be ignored <ul><li>in favor of g_html_valid_tags</li></ul>
Description

The comment for the $g_html_valid_tags_single_line configuration variable says that it is purposed to specify valid tags for single line fields (e.g. issue summary).

Unfortunately, in case of mantis 1.2.15 it seems to be ignored (at least in case of the summary field) and the field value is filtered rather on basis of the g_html_valid_tags variable.

<strong>Expected:</strong>
Either use the $g_html_valid_tags_single_line variable for filtering of the summary field or consider it a feature and adjust proper comment in the config_defaults_inc.php file.

Steps To Reproduce

<ol>
<li>
Add following two lines to the config_inc.php file:
<pre>
$g_html_valid_tags = 'p, li, ul, ol, br, pre, i, b, u, em, strong, code';
$g_html_valid_tags_single_line = 'i, b, u, em, strong, code';
</pre>
</li>
<li>Create a new issue with the code tag used both in its summary and description.</li>
<li>Observe the tags rendered.</li>
<li>Remove the code tag from the $g_html_valid_tags_single_line setting.</li>
<li><b>bug</b> Observe the code tag rendered in the summary field (as well as in the description field).</li>
<li>Remove the code tag from the $g_html_valid_tags setting and add it back to the $g_html_valid_tags_single_line setting.</li>
<li><b>bug</b> Observe the code tag filtered in both the summary and the description fields.</li>
</ol>

TagsNo tags attached.

Activities

atrol

atrol

2013-08-31 14:15

developer   ~0037960

This is caused by always calling string_restore_valid_html_tags with second parameter $p_multiline = true or calling string_restore_valid_html_tags without second parameter.

atrol

atrol

2013-08-31 15:41

developer   ~0037961

Replacing two times
$t_string = string_restore_valid_html_tags( $t_string, / multiline = / true );
by
$t_string = string_restore_valid_html_tags( $t_string, $p_multiline );
in file plugins/MantisCoreFormatting/MantisCoreFormatting.php
seems to fix the issue.

I am a bit unsure as the fix is quite obvious and simple.

dregad

dregad

2013-09-01 08:55

developer   ~0037966

@atrol, I had a look at the code and I believe your proposed fix is correct.

This bug is probably the result of an oversight or copy-paste error at the time the plugin was created (see https://github.com/mantisbt/mantisbt/commit/f3ff104c).

Will commit shortly.

Related Changesets

MantisBT: master-1.2.x 924be864

2013-08-31 11:41

atrol

Committer: dregad


Details Diff
MantisCoreFormatting: Fix single-line fields html tags processing

Methods text() and formatted() Plugin sent a hardcoded 'true' parameter
to string_restore_valid_html_tags(), instead of using the method's
$p_multiline parameter.

Fixes 0016342
Affected Issues
0016342
mod - plugins/MantisCoreFormatting/MantisCoreFormatting.php Diff File

MantisBT: master 1b99f13e

2013-08-31 11:41

atrol

Committer: dregad


Details Diff
MantisCoreFormatting: Fix single-line fields html tags processing

Methods text() and formatted() Plugin sent a hardcoded 'true' parameter
to string_restore_valid_html_tags(), instead of using the method's
$p_multiline parameter.

Fixes 0016342
Affected Issues
0016342
mod - plugins/MantisCoreFormatting/MantisCoreFormatting.php Diff File