View Issue Details

IDProjectCategoryView StatusLast Update
0003252mantisbtbugtrackerpublic2003-12-13 04:36
Reporterquarkbaellchen Assigned Tovboctor  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionopen 
Product Version0.18.0a4 
Summary0003252: category not selected on update if "&" is used in category name
Description

If you try to update a bug with a "&" char in the category this category will not be selected (it should be <option value="" selected="selected"></option>). You can fix this by change the function
function check_selected( $p_var, $p_val=true ) {
if ( $p_var == $p_val ) {
echo ' selected="selected" ';
}
}
to
function check_selected( $p_var, $p_val=true ) {
if ( htmlspecialchars($p_var) == $p_val ) {
echo ' selected="selected" ';
}
}
. You can find this function in core/helper_api.php (Mantis 0.18.0a4). As the chars in $p_val are already escaped you just have to escape $p_var.

TagsNo tags attached.

Activities

vboctor

vboctor

2003-08-04 16:29

manager   ~0004482

Thanks for tracking down the problem. I didn't use the proposed fix since check_selected() should always be called with strings that are already escaped. Having the escaping inside it will cause some strings to be escaped more than once.

I committed the fix to CVS, but I don't have access to MySQL at the moment to test the fix. Feel free to try out the latest code from CVS and post the results here. If not, I will test it and confirm the fix.

vboctor

vboctor

2003-08-05 00:56

manager   ~0004484

Fix tested. Will be available in 0.18.0a5.

Related Changesets

MantisBT: master a4e3c593

2003-08-04 10:26

vboctor


Details Diff
Fix 0003252: Category not selected on update if "&" is used in category name.

M core/print_api.php
- Use string_attribute() on strings before outputting them to html and calling check_selected(). [the fix is not yet tested]

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2207 <a class="text" href="/?p=mantisbt.git;a=object;h=f5dc347c">f5dc347c</a>-c33d-0410-90a0-b07cc1902cb9
Affected Issues
0003252
mod - core/print_api.php Diff File
mod - doc/ChangeLog Diff File