Skip to content

Commit

Permalink
When downloading Word/Excel exports, spaces in the title caused the e…
Browse files Browse the repository at this point in the history
…ntire filename to be abandoned. In addition, 'special' characters in the title would cause part of the title to be cut off.

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@1197 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
Jeroen Latour committed Aug 15, 2002
1 parent 074c06d commit 0fe7f3e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
3 changes: 2 additions & 1 deletion print_all_bug_page_excel.php
Expand Up @@ -17,8 +17,9 @@
# excel or html export
if ( $f_type_page != 'html' ) {
$t_export_title = $g_page_title."_excel";
$t_export_title = ereg_replace('[\/:*?"<>|]', '', $t_export_title);
header('Content-Type: application/vnd.ms-excel');
header( "Content-Disposition: attachment; filename=$t_export_title.xls" );
header('Content-Disposition: attachment; filename="' . $t_export_title . '.xls"');
}

# check to see if the cookie does not exist
Expand Down
34 changes: 17 additions & 17 deletions print_all_bug_page_word.php
Expand Up @@ -12,14 +12,14 @@
<?php include( 'core_API.php' ) ?>
<?php login_cookie_check() ?>
<?php

# word or html export
if ( $f_type_page != 'html' ) {
$t_export_title = $g_page_title."_word";
$t_export_title = ereg_replace('[\/:*?"<>|]', '', $t_export_title);
header('Content-Type: application/msword');
header( "Content-Disposition: attachment; filename=$t_export_title.doc" );
header('Content-Disposition: attachment; filename="' . $t_export_title . '.doc"');
}

# check to see if the cookie does not exist
if ( empty( $g_view_all_cookie_val ) ) {
print_header_redirect( 'view_all_set.php?f_type=0&amp;f_print=1' );
Expand Down Expand Up @@ -311,8 +311,8 @@
<td class="print">
<?php echo $v_platform ?>
</td>
<td class="print" colspan="2">
&nbsp;
<td class="print" colspan="2">&nbsp;

</td>
</tr>
<tr class="print">
Expand All @@ -328,8 +328,8 @@
<td class="print">
<?php echo $v_os ?>
</td>
<td class="print" colspan="2">
&nbsp;
<td class="print" colspan="2">&nbsp;

</td>
</tr>
<tr class="print">
Expand All @@ -345,8 +345,8 @@
<td class="print">
<?php echo $v_os_build ?>
</td>
<td class="print" colspan="2">
&nbsp;
<td class="print" colspan="2">&nbsp;

</td>
</tr>
<tr class="print">
Expand All @@ -362,8 +362,8 @@
<td class="print">
<?php echo $v_version ?>
</td>
<td class="print" colspan="2">
&nbsp;
<td class="print" colspan="2">&nbsp;

</td>
</tr>
<tr class="print">
Expand All @@ -379,8 +379,8 @@
<td class="print">
<?php echo get_enum_element( 'resolution', $v_resolution ) ?>
</td>
<td class="print" colspan="2">
&nbsp;
<td class="print" colspan="2">&nbsp;

</td>
</tr>
<tr class="print">
Expand All @@ -396,8 +396,8 @@
<td class="print">
<?php print_duplicate_id( $v_duplicate_id ) ?>
</td>
<td class="print" colspan="2">
&nbsp;
<td class="print" colspan="2">&nbsp;

</td>
</tr>
<tr class="print">
Expand All @@ -407,8 +407,8 @@
<td class="print">
<?php echo get_enum_element( 'eta', $v_eta ) ?>
</td>
<td class="print" colspan="4">
&nbsp;
<td class="print" colspan="4">&nbsp;

</td>
</tr>
<tr>
Expand Down

0 comments on commit 0fe7f3e

Please sign in to comment.