hasanarbsq / osfilemanager

Automatically exported from code.google.com/p/osfilemanager
0 stars 0 forks source link

Deleting directories with contents fails #22

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
2.delete a directory containing a file
3.

What is the expected output? What do you see instead?

Expect deirectory and file to be deleted instead get crazy output with system 
cycling thoug files and folders that it cant delete - I have PHP errors turned 
on to see this.

What version of the product are you using? On what operating system? On
what web host?
 Version 2.2 on Centos 5

Please provide any additional information below.

Section of index.php which reads:

    if (is_array($_POST[foldersel])) {
      foreach ($_POST[foldersel] as $file) {
        listdircontents($userdir.$d);
        foreach ($contenta as $delitem) if(@unlink($userdir.$d.$delitem)) echo "<font class=ok>$delitem has been sucessfully deleted.<br>\n";
        foreach ($contentb as $delitem) if(@rmdir($userdir.$d.$delitem)) echo "<font class=ok>$delitem has been sucessfully deleted.<br>\n"; 

SHOULD read:

    if (is_array($_POST[foldersel])) {
      foreach ($_POST[foldersel] as $dir) {
        listdircontents($userdir.$d);
        foreach ($contenta as $delitem) if(@unlink($delitem));
        if(@rmdir($userdir.$d.$dir)) echo "<font class=ok>$dir has been sucessfully deleted.<br>\n";

Original issue reported on code.google.com by pelli...@googlemail.com on 28 Jul 2010 at 9:20

GoogleCodeExporter commented 8 years ago
tried this solution and works but somehow gives me a warning message on top of 
"testdir has been sucessfully deleted" end saying:

opendir(./projects/./projects/./projects/) [function.opendir]: failed to open 
dir: No such file or directory
Invalid argument supplied for foreach()

which is of course my main file dir.

Original comment by werbyvil...@gmail.com on 9 Dec 2010 at 10:09

GoogleCodeExporter commented 8 years ago
that solution didnt worked for me, anyone know a good solution ?

Original comment by shai...@gmail.com on 28 Mar 2012 at 7:16