Code Duplication    Length = 20-20 lines in 2 locations

src/wp-admin/includes/class-ftp.php 1 location

@@ 201-220 (lines=20) @@
198
			$b['owner'] = $lucifer[2];
199
			$b['group'] = $lucifer[3];
200
			$b['size'] = $lucifer[4];
201
			if ($lcount==8) {
202
				sscanf($lucifer[5],"%d-%d-%d",$b['year'],$b['month'],$b['day']);
203
				sscanf($lucifer[6],"%d:%d",$b['hour'],$b['minute']);
204
				$b['time'] = @mktime($b['hour'],$b['minute'],0,$b['month'],$b['day'],$b['year']);
205
				$b['name'] = $lucifer[7];
206
			} else {
207
				$b['month'] = $lucifer[5];
208
				$b['day'] = $lucifer[6];
209
				if (preg_match("/([0-9]{2}):([0-9]{2})/",$lucifer[7],$l2)) {
210
					$b['year'] = date("Y");
211
					$b['hour'] = $l2[1];
212
					$b['minute'] = $l2[2];
213
				} else {
214
					$b['year'] = $lucifer[7];
215
					$b['hour'] = 0;
216
					$b['minute'] = 0;
217
				}
218
				$b['time'] = strtotime(sprintf("%d %s %d %02d:%02d",$b['day'],$b['month'],$b['year'],$b['hour'],$b['minute']));
219
				$b['name'] = $lucifer[8];
220
			}
221
		}
222
223
		return $b;

src/wp-admin/includes/class-wp-filesystem-ftpext.php 1 location

@@ 513-532 (lines=20) @@
510
			$b['owner'] = $lucifer[2];
511
			$b['group'] = $lucifer[3];
512
			$b['size'] = $lucifer[4];
513
			if ( $lcount == 8 ) {
514
				sscanf($lucifer[5], '%d-%d-%d', $b['year'], $b['month'], $b['day']);
515
				sscanf($lucifer[6], '%d:%d', $b['hour'], $b['minute']);
516
				$b['time'] = @mktime($b['hour'], $b['minute'], 0, $b['month'], $b['day'], $b['year']);
517
				$b['name'] = $lucifer[7];
518
			} else {
519
				$b['month'] = $lucifer[5];
520
				$b['day'] = $lucifer[6];
521
				if ( preg_match('/([0-9]{2}):([0-9]{2})/', $lucifer[7], $l2) ) {
522
					$b['year'] = date("Y");
523
					$b['hour'] = $l2[1];
524
					$b['minute'] = $l2[2];
525
				} else {
526
					$b['year'] = $lucifer[7];
527
					$b['hour'] = 0;
528
					$b['minute'] = 0;
529
				}
530
				$b['time'] = strtotime( sprintf('%d %s %d %02d:%02d', $b['day'], $b['month'], $b['year'], $b['hour'], $b['minute']) );
531
				$b['name'] = $lucifer[8];
532
			}
533
		}
534
535
		// Replace symlinks formatted as "source -> target" with just the source name