Flyspray - The bug killer!

  • Status New
  • Percent Complete
    0%
  • Task Type Bug Report
  • Category Backend/Core
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Low
  • Reported Version 1.0-rc
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Flyspray - The bug killer!
Opened by peterdd - 24.01.2017
Last edited by peterdd - 24.01.2017

FS#2332 - CSV export filename filtering

The filename for the csv export is build based on project name and current date.

Due different handling of web browsers, the appropriate http header should send the filename in ascii and also provide them as utf-8 for web browsers who can handle that.

Related RFC5987

Project Manager
peterdd commented on 24.01.2017 03:43

current playground:

$outfile = sprintf('%s_%s.csv', preg_replace('/[^\d|\w]+/', '_', $proj->prefs['project_title']), date("Y-m-d"));

#$outfileutf8 = str_replace(' ', '_', utf8_decode($proj->prefs['project_title'])).'_'.date("Y-m-d").'.csv';
#$outfileascii = sprintf('%s_%s.csv', preg_replace('/[^\d*|^\w*]+/', '_', $proj->prefs['project_title']), date("Y-m-d"));
#if(function_exists('iconv')){
#       setlocale(LC_CTYPE, 'de_DE.utf8');
#       $outfileascii = sprintf( '%s_%s.csv', iconv('UTF-8', 'ASCII//TRANSLIT', $proj->prefs['project_title']), date("Y-m-d"));
#} else{
#       $outfileascii = sprintf( '%s_%s.csv', preg_replace('/[^\d*|^\w*]+/', '_', $proj->prefs['project_title']), date("Y-m-d"));
#}

#header('Content-Type: application/csv');
header('Content-Type: text/csv');
#header('Content-Disposition: attachment; filename="'.$outfileascii.'"; filename*=utf-8\'\''.$outfileutf8); # see RFC5987
header('Content-Disposition: attachment; filename="'.$outfile);
header('Content-Transfer-Encoding: binary');

Got this far:

  • Without rfc5987 variant utf8 filenames for download works with firefox, but not IE Edge.
  • With rfc5987 variant utf8 filenames for download works with IE Edge, but not Firefox nor Chrome...
Project Manager
peterdd commented on 24.01.2017 04:12

rawurlencode() seems to be our friend ..

quick test works with IE Edge, Firefox, Chrome.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing