-
-
Notifications
You must be signed in to change notification settings - Fork 4
Description
FireFS::toInternalPath prepends working directory (which is confusingly referred to as $this->rootPath) to absolute path.
Example:
Current working directory is /Users/dennis/bin/
FileFS::toIntenralPath('/Users/dennis/Docs')
Result: /Users/dennis/bin/Users/dennis/Docs
To circumvent this, I have modified from line 368 as follows:
// Prepend the root path
if (substr($internalPath, 0, 1) !== DIRECTORY_SEPARATOR) { // Added - Lovelady, 7-Feb-2024 (process was prepending "root path" to absolute path)
$rootPath = $this->rootPath();
if (!empty($rootPath)) {
$internalPath = $this->makePath($rootPath, $internalPath);
}
} // Added - Lovelady, 7-Feb-2024 (process was prepending "root path" to absolute path)
But since I don't necessarily understand all the conditions that this routine might be trying to address, I am not certain this is a fix for all conditions. It would be better to have the source fixed in the official distribution. It was very tempting, for example, to test for (substr($internalPath, 0, 1) !== DIRECTORY_SEPARATOR) and return unchanges on true, right at the top of toInternalPath(), which is where I suspect it actually belongs.