| Anonymous | Login | Signup for a new account | 2010-07-29 10:15 EDT | ![]() |
| Main | My View | View Issues | Change Log | Roadmap | Wiki | ManTweet | Repositories |
| View Issue Details [ Jump to Notes ] [ Wiki ] | [ Issue History ] [ Print ] | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |
| 0010420 | mantisbt | csv | public | 2009-04-27 08:02 | 2009-06-23 15:26 | |
| Reporter | kesterhabermann | |||||
| Assigned To | grangeway | |||||
| Priority | normal | Severity | minor | Reproducibility | always | |
| Status | closed | Resolution | fixed | |||
| Platform | any | OS | any | OS Version | any | |
| Product Version | 1.1.7 | |||||
| Target Version | Fixed in Version | 1.2.0rc1 | ||||
| Summary | 0010420: Custom fields with newline break CSV export | |||||
| Description | Multiline entries in custom fields break CSV export as the newlines appear in the CSV. The following change to "csv_export.php" and "core/csv_api.php" will remove the newlines in the CSV export for all fields: --- mantisbt-1.1.7.orig/csv_export.php 2009-04-20 15:14:00.000000000 +0200 +++ mantisbt-1.1.7/csv_export.php 2009-04-27 11:38:07.352036000 +0200 @@ -116,11 +117,7 @@ helper_call_custom_function( $t_column_value_function, array( $t_column, $t_row, COLUMNS_TARGET_CSV_PAGE ) ); $t_value = ob_get_clean(); - if ( strstr( $t_value, $t_sep ) !== false ) { - $t_value = '"' . $t_value . '"'; - } - - echo $t_value; + echo csv_escape_string($t_value); } else { $t_function = 'csv_format_' . $t_column; echo $t_function( $t_row[ $t_column ] ); --- mantisbt-1.1.7.orig/core/csv_api.php 2009-04-20 15:14:00.000000000 +0200 +++ mantisbt-1.1.7/core/csv_api.php 2009-04-27 11:23:37.844829000 +0200 @@ -57,6 +57,9 @@ $p_str = '"' . str_replace( '"', '""', $p_str ) . '"'; } + $p_str = str_replace("\n", '', $p_str); + $p_str = str_replace("\r", '', $p_str); + return $p_str; } | |||||
| Tags | No tags attached. | |||||
| Attached Files | ||||||
Notes |
|
|
grangeway (developer) 2009-05-23 12:27 |
Partial commit of your patch in 1.2, it looks like csv_escape_string has been modified to quote strings containing new line characters Paul |
|
kesterhabermann (reporter) 2009-06-12 05:51 |
Still broken in 1.1.8. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2009-04-27 08:02 | kesterhabermann | New Issue | |
| 2009-04-27 08:09 | kesterhabermann | File Added: mantisbt-1.1.7-csv.patch | |
| 2009-05-23 12:27 | grangeway | Note Added: 0021890 | |
| 2009-05-23 12:27 | grangeway | Status | new => resolved |
| 2009-05-23 12:27 | grangeway | Fixed in Version | => 1.2.x |
| 2009-05-23 12:27 | grangeway | Resolution | open => fixed |
| 2009-05-23 12:27 | grangeway | Assigned To | => grangeway |
| 2009-06-12 05:51 | kesterhabermann | Note Added: 0022113 | |
| 2009-06-23 15:26 | jreese | Status | resolved => closed |
| MantisBT 1.2.2 git master-1.2.x[^]
Copyright © 2000 - 2010 MantisBT Group
Time: 0.2440 seconds. memory usage: 1,945 KB |