View Issue Details

IDProjectCategoryView StatusLast Update
0007816mantisbtbugtrackerpublic2007-05-08 03:43
Reportermatthijs Assigned Tovboctor  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.1.0a2 
Fixed in Version1.1.0a3 
Summary0007816: Excel export needs htmlspecialchars() on description, steps_to_reproduce, additional_info
Description

If the description has HTML inside, the print Excel export fails.

Patch:

[raw]Index: print_all_bug_page_excel.php

RCS file: /cvsroot/mantisbt/mantisbt/print_all_bug_page_excel.php,v
retrieving revision 1.54
diff -U3 -r1.54 print_all_bug_page_excel.php
--- print_all_bug_page_excel.php 11 Nov 2006 07:37:59 -0000 1.54
+++ print_all_bug_page_excel.php 12 Mar 2007 17:22:15 -0000
@@ -145,9 +145,9 @@

         # line feeds are desactivated in case of excel export, to avoid multiple lines
         if ( $f_type_page != 'html' ) {
  • $v2_description = stripslashes( str_replace( '\n',' ',$v2_description ));
  • $v2_steps_to_reproduce = stripslashes( str_replace( '\n',' ',$v2_steps_to_reproduce ) );
  • $v2_additional_information = stripslashes( str_replace( '\n',' ',$v2_additional_information ));
  • $v2_description = stripslashes( htmlspecialchars( str_replace( '\n',' ',$v2_description )));
  • $v2_steps_to_reproduce = stripslashes( htmlspecialchars( str_replace( '\n',' ',$v2_steps_to_reproduce ) ) );
  • $v2_additional_information = stripslashes( htmlspecialchars( str_replace( '\n',' ',$v2_additional_information )));
    } else {
    $v2_description = string_display_links( $v2_description );
    $v2_steps_to_reproduce = string_display_links( $v2_steps_to_reproduce );
    [/raw]
TagsNo tags attached.
Attached Files
mantis_htmlspecialchars.diff (1,327 bytes)   
Index: print_all_bug_page_excel.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/print_all_bug_page_excel.php,v
retrieving revision 1.54
diff -U3 -r1.54 print_all_bug_page_excel.php
--- print_all_bug_page_excel.php	11 Nov 2006 07:37:59 -0000	1.54
+++ print_all_bug_page_excel.php	12 Mar 2007 17:27:49 -0000
@@ -145,9 +145,9 @@
 
             # line feeds are desactivated in case of excel export, to avoid multiple lines
             if ( $f_type_page != 'html' ) {
-				$v2_description = stripslashes( str_replace( '\n',' ',$v2_description ));
-				$v2_steps_to_reproduce  = stripslashes( str_replace( '\n',' ',$v2_steps_to_reproduce ) );
-				$v2_additional_information = stripslashes( str_replace( '\n',' ',$v2_additional_information ));
+				$v2_description = stripslashes( htmlspecialchars( str_replace( '\n',' ',$v2_description )));
+				$v2_steps_to_reproduce  = stripslashes( htmlspecialchars( str_replace( '\n',' ',$v2_steps_to_reproduce ) ) );
+				$v2_additional_information = stripslashes( htmlspecialchars( str_replace( '\n',' ',$v2_additional_information )));
             } else {
                 $v2_description 			= string_display_links( $v2_description );
                 $v2_steps_to_reproduce 		= string_display_links( $v2_steps_to_reproduce );
mantis_htmlspecialchars.diff (1,327 bytes)   

Activities