Bug #67009 [NEW]: ftp:// stream wrapper doesn't work with Microsoft FTP Service
| From: | vosa at binaryparadise dot com | Date: | Thu, 03 Apr 2014 11:55:10 +0000 |
| Subject: | Bug #67009 [NEW]: ftp:// stream wrapper doesn't work with Microsoft FTP Service | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-185066@lists.php.net to get a copy of this message | ||
From: vosa at binaryparadise dot com
Operating system: debian, solaris
PHP version: Irrelevant
Package: Streams related
Bug Type: Bug
Bug description:ftp:// stream wrapper doesn't work with Microsoft FTP
Service
Description:
------------
---
From manual page: http://www.php.net/wrappers.ftp
---
Hi,
I have some troubles with getting list of files from Microsoft's FTP
server (Microsoft FTP Service) using ftp:// stream wrapper. There is
difference in output, when trailing slash is used or not. I didn't see
this problem, when other FTP server (i.e. pure-ftpd) is used.
I tried scan directory with scandir() function, but I get same output
using readdir(). See test script.
There is a big problem to get list of files recursively. Directories
with backslashes are incorrect and testing functions (like file_exists,
is_dir, is_file) doesn't consider those paths correct.
This problem occured even with DirectoryIterator with or without
trailing slash.
Test script:
---------------
# ftp folder structure:
# /test_folder
# dir1
# file1
# dir2
# file2
$path = 'ftp://user:password@192.168.1.1/test_folder/';
print "with trailing slash:\n";
foreach(scandir($path) as $file) {
print "$file\n";
}
print "without trailing slash:\n"
$path = substr($path, 0, -1);
foreach(scandir($path) as $file) {
print "$file\n";
}
Expected result:
----------------
with trailing slash:
dir1
dir2
without trailing slash:
dir1
dir2
Actual result:
--------------
with trailing slash:
dir1
dir2
without trailing slash:
test_folder\dir1
test_folder\dir2
--
Edit bug report at https://bugs.php.net/bug.php?id=67009&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67009&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67009&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67009&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67009&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67009&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67009&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67009&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67009&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67009&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67009&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67009&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67009&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67009&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67009&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67009&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67009&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67009&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67009&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67009&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67009&r=mysqlcfg