Opened 16 years ago
Closed 16 years ago
#10060 closed defect (bug) (fixed)
Incorrect behavior of "WP_Filesystem_FTPext -> exists"
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.8 |
Component: | Filesystem API | Keywords: | has-patch needs-testing commit |
Focuses: | Cc: |
Description
FTP server on my web hosting returns something like a
ftpd: /www/dirname: No such file or directory
as a response of ftp_rawlist function. So this part of code works incorrectly
function exists($file) { $list = @ftp_rawlist($this->link, $file, false); return !empty($list); //empty list = no file, so invert. }
My temporary workaround is:
function exists($file) { $list = @ftp_rawlist($this->link, $file, false); return !(empty($list) || (strpos($list[0], "No such file or directory") !== FALSE)); }
Attachments (1)
Change History (7)
#3
@
16 years ago
- Keywords needs-patch needs-testing added
- Milestone changed from 2.8 to 2.9
- Status changed from new to accepted
I'll try and confirm that nlist works as expected.
Bumping to 2.9 due to 2.8's close release, there'll be no time to test if this actually works correctly for the majority.
#4
@
16 years ago
- Keywords has-patch commit added; needs-patch removed
Tested on VSFtp (linux) and FileZilla on windows, Seems to work as expected with nlist()
However it needs to be mentioned that neither of these servers returned verbose errors on file-not-existing..
Note: See
TracTickets for help on using
tickets.
might we want to use http://fr2.php.net/manual/en/function.ftp-nlist.php instead?