Skip to content

Commit

Permalink
Merge pull request #2928 from Dolibarr/revert-1446-removefiles
Browse files Browse the repository at this point in the history
Revert "Made test pessimistic by default"
  • Loading branch information
eldy committed May 29, 2015
2 parents eb62c7e + d925ecb commit 92440d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions htdocs/core/lib/files.lib.php
Expand Up @@ -802,7 +802,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
*/
function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=null)
{
global $langs;
global $db, $conf, $user, $langs;
global $hookmanager;

$langs->load("other");
Expand All @@ -829,8 +829,10 @@ function dol_delete_file($file,$disableglob=0,$nophperrors=0,$nohook=0,$object=n
}
else
{
$error=0;

//print "x".$file." ".$disableglob;exit;
$ok=false;
$ok=true;
$file_osencoded=dol_osencode($file); // New filename encoded in OS filesystem encoding charset
if (empty($disableglob) && ! empty($file_osencoded))
{
Expand Down
3 changes: 2 additions & 1 deletion test/phpunit/FilesLibTest.php
Expand Up @@ -339,9 +339,10 @@ public function testDolCopyMoveDelete()
print __METHOD__." result=".$result."\n";
$this->assertTrue($result,'delete file');

// Again to test no error when deleteing a non existing file
$result=dol_delete_file($conf->admin->dir_temp.'/file2.csv');
print __METHOD__." result=".$result."\n";
$this->assertFalse($result,'delete file that does not exists');
$this->assertTrue($result,'delete file that does not exists');

// Test copy with special char / delete with blob
$result=dol_copy($file, $conf->admin->dir_temp.'/file with [x] and é.csv',0,1);
Expand Down

0 comments on commit 92440d1

Please sign in to comment.