Fix: Remove separator files.

This commit is contained in:
Laurent Destailleur 2013-04-30 23:08:07 +02:00
parent 786bf9d035
commit 0a71c84bf4
2 changed files with 6 additions and 6 deletions

View File

@ -176,7 +176,7 @@ class ImportCsv extends ModeleImports
*/ */
function write_title_example($outputlangs,$headerlinefields) function write_title_example($outputlangs,$headerlinefields)
{ {
$s.=join($this->separator,array_map('cleansep',$headerlinefields)); $s=join($this->separator,array_map('cleansep',$headerlinefields));
return $s."\n"; return $s."\n";
} }
@ -636,12 +636,12 @@ class ImportCsv extends ModeleImports
/** /**
* Clean a string from separator * Clean a string from separator
* *
* @param string $value Remove separator * @param string $value Remove standard separators
* @return string String without separator * @return string String without separators
*/ */
function cleansep($value) function cleansep($value)
{ {
return str_replace(',','/',$value); return str_replace(array(',',';'),'/',$value);
}; };
/** /**

View File

@ -345,12 +345,12 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
// Test copy with special char / delete with blob // Test copy with special char / delete with blob
$result=dol_copy($file, $conf->admin->dir_temp.'/file with [x] and é.csv',0,1); $result=dol_copy($file, $conf->admin->dir_temp.'/file with [x] and é.csv',0,1);
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
$this->assertGreaterThanOrEqual(1,$result,'copy destination already exists, overwrite'); // Should be 1 $this->assertGreaterThanOrEqual(1,$result,'copy file with special chars, overwrite'); // Should be 1
// Try to delete using a glob criteria // Try to delete using a glob criteria
$result=dol_delete_file($conf->admin->dir_temp.'/file with [x]*é.csv'); $result=dol_delete_file($conf->admin->dir_temp.'/file with [x]*é.csv');
print __METHOD__." result=".$result."\n"; print __METHOD__." result=".$result."\n";
$this->assertTrue($result,'delete file that does not exists'); $this->assertTrue($result,'delete file using glob');
} }
/** /**