[SPIP][PLUGINS] v3.0-->v3.2
[lhc/web/www.git] / www / plugins / spip-bonux-3 / inc / exporter_csv.php
index 769c16e..bdd0323 100644 (file)
@@ -72,6 +72,7 @@ function inc_exporter_csv_dist($titre, $resource, $delim = ',', $entetes = null,
        }
        $filename = "$filename.$extension";
 
+       $output = '';
        if ($entetes and is_array($entetes) and count($entetes)) {
                $output = exporter_csv_ligne($entetes, $delim, $importer_charset);
        }
@@ -87,8 +88,8 @@ function inc_exporter_csv_dist($titre, $resource, $delim = ',', $entetes = null,
                $length += fwrite($fp, $output);
        }
        fclose($fp);
-
        if ($envoyer) {
+               ob_start();
                Header("Content-Type: text/comma-separated-values; charset=$charset");
                Header("Content-Disposition: attachment; filename=$filename");
                //non supporte