User tests: Successful: Unsuccessful:
We are migrating away from the Joomla\CMS\Filesystem
classes to the framework Filesystem classes. This PR replaces all occurences of Joomla\CMS\Filesystem\Folder::exists()
with is_dir()
. The former method does not exist in the framework class, mainly because it is an unnecessary wrapper for the later. Where necessary, an import for Joomla\Filesystem\Path
has been added and unnecessary ones removed. All the existing imports to Joomla\CMS\Filesystem\Path
are changed to the framework package in another PR.
Joomla\Filesystem\Path::clean()
should be used when the given path can not be 100% assumed to be safe, for example when the path is coming from some outside input. That method will make sure that a path will have the systems directory separator and not contain double slashes or double backslashes.
Codereview
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Category | ⇒ | Administration com_admin com_config com_menus com_templates Libraries Front End Plugins |
Status | New | ⇒ | Pending |
Done.
Labels |
Added:
PR-4.4-dev
|
Title |
|
Labels |
Added:
bug
PR-5.0-dev
Removed: PR-4.4-dev |
Labels |
Added:
b/c break
|
I fixed the merge conflict but I'm not 100% sure if it make sense, since now we call is_dir(Path::clean())
before we just call Folder::exists()
which implicit called Path::clean()
for 3rd party developer it's possible that they forget or ignore the Path::clean()
which might be an issue?
The nice thing is, that we are not changing third party code, but just our core code. After this change, third party code will still behave the same. ?
The Codestyle error reported here is unrelated to this PR.
Title |
|
Labels |
Added:
Feature
Maintainers Checked
PR-5.1-dev
Removed: bug |
Labels |
Removed:
b/c break
|
I have tested this item ✅ successfully on 58f6055
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2024-03-02 06:38:15 |
Closed_By | ⇒ | bembelimen | |
Labels |
Added:
RTC
|
Thx
It would be helpful for extension developers when you can write a couple of words in the pr description why you have used
Path::clean
.