The file manager allows the user to copy recursively one directory into itself. The problem is that it creates the same directory structure several times (673 times in our GNU/Linux server), one inside the next.
For example, if you have this structure:
/x/y/z
and then copy y into y (itself), the file manager creates this:
/x/y/z
/x/y/y
/x/y/y/y
/x/y/y/y/y
... etc, until hundreds of levels are created.
Fortunatelly phpfm can delete the mess, because (for example) if the server is a Windows server, Windows Explorer cannot delete the nested directories (it raises a 1148 file system error).
The expected behavior is:
1) disallow this (just checking if the source and target are the same) or...
2) allow it but stop going down into the new directory structure (keeping a list in memory or tagging the directories with a file or whatever).
Regards,
Mario A. Valdez-Ramirez.
Diff: