New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEATURE: Files::isAbsolutePath
and Files::isRealPath
#3235
base: 9.0
Are you sure you want to change the base?
FEATURE: Files::isAbsolutePath
and Files::isRealPath
#3235
Conversation
Files::isAbsolute
and Files::isRealPath
Files::isAbsolutePath
and Files::isRealPath
Neos.Utility.Files/Classes/Files.php
Outdated
* That means its absolute and has no directory traversal. | ||
* {@see realpath()} | ||
*/ | ||
public static function isRealPath(string $path): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be misleading as the linux realpath
has another important function, which is to resolve symlinks, and we do not know if this path contains symlinks. As in /var/www/app/current/Web
vs /var/www/app/20231219/Web
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes maybe isAbsoluteUnixStyleFilePathWithoutDirectoryTraversal
?
This might still be useful just to be able to do a simple optional assertion, so we notice more quickly if something is wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or isSimpleAbsoluteUnixPath
isPureUnixPath
or isCleanUnixPath
? idk
-> isFullyQualified
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes and the symlinking thing is exactly what lead to this bug rendering the helper obsolete.
So I guess we only need the first helper
These new utility methods are needed by neos. And its best to place them into the utility with additional tests.
See
Upgrade instructions
Review instructions
Checklist
FEATURE|TASK|BUGFIX
!!!
and have upgrade-instructions