In #935036: File exists in FileTransferFTPExtension->createDirectoryJailed(), we subclassed RecursiveDirectoryIterator to provide an iterator which skips '.' and '..' files. This was necessary since there was no built-in mechanism in PHP 5.2 to accomplish this. In PHP 5.3 RecursiveDirectoryIterator's parent was changed to FilesystemIterator which provides a convenient SKIP_DOTS flag.
This means we can remove the SkipDotsRecursiveDirectoryIterator compatibility layer and replace all calls like
new SkipDotsRecursiveDirectoryIterator($path)
with new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS)
.
Since this requires PHP 5.3, this is for Drupal 8 only. I'm filing under update.module, but the relevant code all lies under includes/filetransfer/....
Comments
Comment #1
bfroehle CreditAttribution: bfroehle commentedPatch attached.
Comment #2
xjmTagging as novice for the task of rerolling the Drupal 8.x patch on account of #22336: Move all core Drupal files under a /core folder to improve usability and upgrades.
If you need help rerolling this patch, you can come to core office hours or ask in #drupal-gitsupport on IRC.
Comment #3
bfroehle CreditAttribution: bfroehle commentedComment #4
PedroKTFC CreditAttribution: PedroKTFC commentedIs there a version of this for Drupal 7?
Bump!
Comment #5
areke CreditAttribution: areke commentedIt looks like this needs a re-roll.
Comment #6
falc0 CreditAttribution: falc0 commentedComment #7
falc0 CreditAttribution: falc0 commentedComment #8
falc0 CreditAttribution: falc0 commentedAdded new patch, accidentally removed backslashes in previous one.
Comment #10
falc0 CreditAttribution: falc0 commented8: remove-skipdotsrecursivedirectoryiterator.patch queued for re-testing.
Comment #11
tstoecklerThe patch no longer removes the actual class. Also, since we're already changing it, we should always prefix the native PHP classes with a backlash.
Comment #13
alansaviolobo CreditAttribution: alansaviolobo commentedsince the class doesn't exist anymore, this can be closed.