Code Duplication    Length = 11-14 lines in 2 locations

includes/filerepo/FileRepo.php 2 locations

@@ 442-455 (lines=14) @@
439
		# Now try an old version of the file
440
		if ( $time !== false ) {
441
			$img = $this->newFile( $title, $time );
442
			if ( $img ) {
443
				$img->load( $flags );
444
				if ( $img->exists() ) {
445
					if ( !$img->isDeleted( File::DELETED_FILE ) ) {
446
						return $img; // always OK
447
					} elseif ( !empty( $options['private'] ) &&
448
						$img->userCan( File::DELETED_FILE,
449
							$options['private'] instanceof User ? $options['private'] : null
450
						)
451
					) {
452
						return $img;
453
					}
454
				}
455
			}
456
		}
457
458
		# Now try redirects
@@ 547-557 (lines=11) @@
544
		# Now try to find a matching old version of a file...
545
		if ( $time !== false && $this->oldFileFactoryKey ) { // find-by-sha1 supported?
546
			$img = call_user_func( $this->oldFileFactoryKey, $sha1, $this, $time );
547
			if ( $img && $img->exists() ) {
548
				if ( !$img->isDeleted( File::DELETED_FILE ) ) {
549
					return $img; // always OK
550
				} elseif ( !empty( $options['private'] ) &&
551
					$img->userCan( File::DELETED_FILE,
552
						$options['private'] instanceof User ? $options['private'] : null
553
					)
554
				) {
555
					return $img;
556
				}
557
			}
558
		}
559
560
		return false;