You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The response from windows-ftp-server has a human readable format.
This contains padding whitespaces.
In function normalizeWindowsObject() is a trim used for this problem,
but in detectSystemType() is the item unfiltered used and the function returns always ‘unix’.
Finally, the item can’t be normalized because there are no 9 parts for unix format.
How to reproduce
Testable with windows server or with unit test, response has prefixed white spaces in meta data.
Bug Report
Summary
The response from windows-ftp-server has a human readable format.
This contains padding whitespaces.
In function normalizeWindowsObject() is a trim used for this problem,
but in detectSystemType() is the item unfiltered used and the function returns always ‘unix’.
Finally, the item can’t be normalized because there are no 9 parts for unix format.
How to reproduce
Testable with windows server or with unit test, response has prefixed white spaces in meta data.
Test
tests/FtpTests.php
if (strpos($directory, 'file4.txt') !== false) { return [ ' 2016-05-23 12:09PM 684 file4.txt', ]; }
Fix
protected function detectSystemType($item) { return preg_match('/^[0-9]{2,4}-[0-9]{2}-[0-9]{2}/', trim($item)) ? 'windows' : 'unix'; }
The text was updated successfully, but these errors were encountered: