[svn r15088] Added checks to avoid warning (see FS#2460.33)

skala
Yannick Warnier 17 years ago
parent 9c6a21eaf8
commit 377c4f385a
  1. 20
      main/inc/lib/export.lib.inc.php

@ -44,15 +44,21 @@ class Export
{
$file = api_get_path(SYS_ARCHIVE_PATH).uniqid('').'.csv';
$handle = @fopen($file, 'a+');
foreach ($data as $index => $row)
if(is_array($data))
{
$line='';
foreach($row as $value)
{
$line .= '"'.str_replace('"','""',$value).'";';
foreach ($data as $index => $row)
{
$line='';
if(is_array($row))
{
foreach($row as $value)
{
$line .= '"'.str_replace('"','""',$value).'";';
}
}
@fwrite($handle, $line."\n");
}
@fwrite($handle, $line."\n");
}
@fclose($handle);
DocumentManager :: file_send_for_download($file, true, $filename.'.csv');

Loading…
Cancel
Save