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
Function ftp_mlsd started returning array with different key case: "name" is still "name", but "type" became "Type" and "modify" became "Modify".
I assume ftp_mlsd returns data as provided by the FTP server and this change was a consequence of our hosting provider modifying the software on FTP server, and not a consequence of changes in PHP.
RFC 3659 states in section 7.5 that fact names are case-insensitive, but because PHP array keys are not, changes like this break the code.
I suggest casing of array keys is unified (always "type" or always "Type").
The text was updated successfully, but these errors were encountered:
One problem with normalizing the case to e.g. lowercase is that people who already rely on their server outputting "Type" instead of "type" will have their code break; unless we add the original casing too. WDYT?
Change like this is of course not backward-compatible, which means it will not be eligible for minor release.
One backward-compatible option is to add a parameter for "key normalisation", for example "keep as is" and "lowercase", default "keep as is". But then there are facts like "UNIX.mode", which (it seems) are usually written as UPPERCASE.lowercase.
Or a parameter "normalise array keys", which would be false by default, but if set to true, sets fact casing as lowercase and UPPERCASE.lowercase (or any other fixed combination of case).
Description
Function
ftp_mlsd
started returning array with different key case: "name" is still "name", but "type" became "Type" and "modify" became "Modify".I assume
ftp_mlsd
returns data as provided by the FTP server and this change was a consequence of our hosting provider modifying the software on FTP server, and not a consequence of changes in PHP.RFC 3659 states in section 7.5 that fact names are case-insensitive, but because PHP array keys are not, changes like this break the code.
I suggest casing of array keys is unified (always "type" or always "Type").
The text was updated successfully, but these errors were encountered: