Fix: Remove separator files.
This commit is contained in:
parent
786bf9d035
commit
0a71c84bf4
@ -176,7 +176,7 @@ class ImportCsv extends ModeleImports
|
||||
*/
|
||||
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";
|
||||
}
|
||||
|
||||
@ -636,12 +636,12 @@ class ImportCsv extends ModeleImports
|
||||
/**
|
||||
* Clean a string from separator
|
||||
*
|
||||
* @param string $value Remove separator
|
||||
* @return string String without separator
|
||||
* @param string $value Remove standard separators
|
||||
* @return string String without separators
|
||||
*/
|
||||
function cleansep($value)
|
||||
{
|
||||
return str_replace(',','/',$value);
|
||||
return str_replace(array(',',';'),'/',$value);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@ -345,12 +345,12 @@ class FilesLibTest extends PHPUnit_Framework_TestCase
|
||||
// Test copy with special char / delete with blob
|
||||
$result=dol_copy($file, $conf->admin->dir_temp.'/file with [x] and é.csv',0,1);
|
||||
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
|
||||
$result=dol_delete_file($conf->admin->dir_temp.'/file with [x]*é.csv');
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertTrue($result,'delete file that does not exists');
|
||||
$this->assertTrue($result,'delete file using glob');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user