Ticket #26802: 26802.diff
File 26802.diff, 1.7 KB (added by , 11 years ago) |
---|
-
class-wp-filesystem-ftpext.php
291 291 if ( is_null($is_windows) ) 292 292 $is_windows = stripos( ftp_systype($this->link), 'win') !== false; 293 293 294 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) ) {294 if ( $is_windows && preg_match( '/([0-9]{2})-([0-9]{2})-([0-9]{2,4}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/', $line, $lucifer ) ) { 295 295 $b = array(); 296 296 if ( $lucifer[3] < 70 ) 297 297 $lucifer[3] +=2000; 298 else 298 elseif ( $lucifer[3] < 1900 ) 299 299 $lucifer[3] += 1900; // 4digit year fix 300 300 $b['isdir'] = ( $lucifer[7] == '<DIR>'); 301 301 if ( $b['isdir'] ) 302 302 $b['type'] = 'd'; 303 303 else 304 304 $b['type'] = 'f'; 305 $b['size'] = $ lucifer[7];305 $b['size'] = $b['isdir'] ? 0 : $lucifer[7]; 306 306 $b['month'] = $lucifer[1]; 307 307 $b['day'] = $lucifer[2]; 308 308 $b['year'] = $lucifer[3]; 309 309 $b['hour'] = $lucifer[4]; 310 if ( strcasecmp( $lucifer[6], "PM" ) == 0 ) 311 $b['hour'] += 12; 310 312 $b['minute'] = $lucifer[5]; 311 $b['time'] = @mktime($lucifer[4] + (strcasecmp($lucifer[6], "PM") == 0 ? 12 : 0), $lucifer[5], 0, $lucifer[1], $lucifer[2], $lucifer[3]); 312 $b['am/pm'] = $lucifer[6]; 313 $b['time'] = @mktime( $b['hour'], $b['minute'], 0, $b['month'], $b['day'], $b['year'] ); 313 314 $b['name'] = $lucifer[8]; 314 } elseif ( !$is_windows && $lucifer = preg_split('/[ ]/', $line, 9, PREG_SPLIT_NO_EMPTY)) { 315 //echo $line."\n"; 315 } elseif ( $lucifer = preg_split( '/[ ]/', $line, 9, PREG_SPLIT_NO_EMPTY ) ) { 316 316 $lcount = count($lucifer); 317 317 if ( $lcount < 8 ) 318 318 return '';