Skip to content
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

fix: allow get_filenames() to follow symlinks #8225

Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion system/Helpers/filesystem_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function get_filenames(

try {
foreach (new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($sourceDir, RecursiveDirectoryIterator::SKIP_DOTS),
new RecursiveDirectoryIterator($sourceDir, RecursiveDirectoryIterator::SKIP_DOTS | FilesystemIterator::FOLLOW_SYMLINKS),
RecursiveIteratorIterator::SELF_FIRST
) as $name => $object) {
$basename = pathinfo($name, PATHINFO_BASENAME);
Expand Down
6 changes: 6 additions & 0 deletions user_guide_src/source/changelogs/v4.4.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ Validation rules matches and differs
Bugs have been fixed in the case where ``matches`` and ``differs`` in the Strict
and Traditional rules validate data of non-string types.

Filesystem Helper
====================================
colethorsen marked this conversation as resolved.
Show resolved Hide resolved

``get_filenames()`` now follows symlink folders, which it previously just returned
colethorsen marked this conversation as resolved.
Show resolved Hide resolved
without following.

***************
Message Changes
***************
Expand Down
2 changes: 2 additions & 0 deletions user_guide_src/source/helpers/filesystem_helper.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ The following functions are available:
the second parameter to 'relative' for relative paths or any other non-empty value for
a full file path.

Prior to v4.4.4, due to a bug, this function did not follow symlink folders.
colethorsen marked this conversation as resolved.
Show resolved Hide resolved

Example:

.. literalinclude:: filesystem_helper/010.php
Expand Down
Loading