The problem we run into is the assumption that $file->getFilename() will return the actual path for the file name.
This means that when we search $currentPath for the filename with .enc at the end to replace it, we will not find it.
This then means $decryptedFilename is the same as $currentPath (which means we don't decrypt the file)
A more concrete example of the variable state after running the code that sets them:
The problem we run into is the assumption that
$file->getFilename()
will return the actual path for the file name. This means that when we search$currentPath
for the filename with.enc
at the end to replace it, we will not find it. This then means$decryptedFilename
is the same as$currentPath
(which means we don't decrypt the file)A more concrete example of the variable state after running the code that sets them:
This is because we're searching for a version of the file without the hash