This came up while testing #395474: Plugin Manager in Core: Part 2 (integration with update status).
http://drupal.org/node/395474#comment-1828684
I looked into WP for how they handle it. btw, that code is hard to read... like, really out there. Anyway:
Looks like they are doing this.
$folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows driveletter if its there.
$folder = str_replace('\\', '/', $folder); //Windows path sanitiation
Looks like we could implement this at the FileTransfer class level. Since I implemented it as a template pattern in #395472: Plugin Manager in Core: Part 1 (backend), we should be able to just override the public methods like CopyDirectory in FileTransfer itself (the base class).
The implementing classes should never have to worry about it, and can always expect unixy paths.
This would be a utility function which should be in FileTransfer and should be called in CopyDirectory, RemoveDirectory, isDir(), basically, anything that is taking a path. It should not need to be implemented in any of the child classes. If it does, we should re-factor to keep the hollywood pattern alive.
Would recommend adding this to the test as well.
Comments
Comment #1
JacobSingh CreditAttribution: JacobSingh commentedMarked as critical as it is blocking a windows environment updater.
Comment #2
cwgordon7 CreditAttribution: cwgordon7 commentedI ran into this problem too, I will try to come up with a patch later tonight.
Comment #3
JacobSingh CreditAttribution: JacobSingh commentedmight be a dupe of #528326: FTP FileTransfer classes need to be able to establish if they are chrooted. Please check that patch.
Comment #4
sun.core CreditAttribution: sun.core commentedMarking as duplicate of #528326: FTP FileTransfer classes need to be able to establish if they are chrooted for now. Feel free to re-open this issue if you want to provide further information. Thanks.