wp-admin/includes/class-wp-filesystem-ftpext.php:689Parses an individual entry from the FTP LIST command output.
$linestringarray|string$namestring
$permsstring
$permsnstring
$numberstring|false
$ownerstring|false
$groupstring|false
$sizestring|false
$lastmodunixstring|false
$lastmodstring|false
$timestring|false
$typestring
$filesarray|false
public function parselisting( $line ) { static $is_windows = null; if ( is_null( $is_windows ) ) { $is_windows = stripos( ftp_systype( $this->link ), 'win' ) !== false; } if ( $is_windows && preg_match( '/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/', $line, $lucifer ) ) { $b = array(); if ( $lucifer[3] < 70 ) { $lucifer[3] += 2000; } else { $lucifer[3] += 1900; // 4-digit year fix. } $b['isdir'] = ( '<DIR>' === $lucifer[7] ); if ( $b['isdir'] ) { $b['type'] = 'd'; } else { $b['type'] = 'f'; } $b['size'] = $lucifer[7]; $b['time'] = mktime( (int) $lucifer[4] + ( strcasecmp( $lucifer[6], 'PM' ) === 0 ? 12 : 0 ), (int) $lucifer[5], 0, (int) $lucifer[1], (int) $lucifer[2], (int) $lucifer[3] ); $b['name'] = $lucifer[8]; } elseif ( ! $is_windows ) { $lucifer = preg_split( '/[ ]/', $line, 9, PREG_SPLIT_NO_EMPTY ); if ( $lucifer ) { $lcount = count( $lucifer ); if ( $lcount < 8 ) { return ''; } $b = array(); $b['isdir'] = 'd' === $lucifer[0][0]; $b['islink'] = 'l' === $lucifer[0][0]; if ( $b['isdir'] ) { $b['type'] = 'd'; } elseif ( $b['islink'] ) { $b['type'] = 'l'; } else { $b['type'] = 'f'; } $b['perms'] = $lucifer[0]; $b['permsn'] = $this->getnumchmodfromh( $b['perms'] ); $b['number'] = $lucifer[1]; $b['owner'] = $lucifer[2]; $b['group'] = $lucifer[3]; $b['size'] = $lucifer[4]; if ( 8 === $lcount ) { sscanf( $lucifer[5], '%d-%d-%d', $year, $month, $day ); sscanf( $lucifer[6], '%d:%d', $hour, $minute ); $b['time'] = mktime( (int) $hour, (int) $minute, 0, (int) $month, (int) $day, (int) $year ); $b['name'] = $lucifer[7]; } else { $month = $lucifer[5]; $day = $lucifer[6]; if ( preg_match( '/([0-9]{2}):([0-9]{2})/', $lucifer[7], $l2 ) ) { $year = gmdate( 'Y' ); $hour = $l2[1]; $minute = $l2[2]; } else { $year = $lucifer[7]; $hour = 0; $minute = 0; } $b['time'] = strtotime( sprintf( '%d %s %d %02d:%02d', $day, $month, $year, $hour, $minute ) ); $b['name'] = $lucifer[8]; } }One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
array to array|string.verified against sourcesrc/wp-admin/includes/class-wp-filesystem-ftpext.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.