@@ 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 |
|
@@ 546-556 (lines=11) @@ | ||
543 | # Now try to find a matching old version of a file... |
|
544 | if ( $time !== false && $this->oldFileFactoryKey ) { // find-by-sha1 supported? |
|
545 | $img = call_user_func( $this->oldFileFactoryKey, $sha1, $this, $time ); |
|
546 | if ( $img && $img->exists() ) { |
|
547 | if ( !$img->isDeleted( File::DELETED_FILE ) ) { |
|
548 | return $img; // always OK |
|
549 | } elseif ( !empty( $options['private'] ) && |
|
550 | $img->userCan( File::DELETED_FILE, |
|
551 | $options['private'] instanceof User ? $options['private'] : null |
|
552 | ) |
|
553 | ) { |
|
554 | return $img; |
|
555 | } |
|
556 | } |
|
557 | } |
|
558 | ||
559 | return false; |