| @@ 72-85 (lines=14) @@ | ||
| 69 | /** |
|
| 70 | * @return mixed|null|Title |
|
| 71 | */ |
|
| 72 | public function getRedirectTarget() { |
|
| 73 | $this->loadFile(); |
|
| 74 | if ( $this->mFile->isLocal() ) { |
|
| 75 | return parent::getRedirectTarget(); |
|
| 76 | } |
|
| 77 | // Foreign image page |
|
| 78 | $from = $this->mFile->getRedirected(); |
|
| 79 | $to = $this->mFile->getName(); |
|
| 80 | if ( $from == $to ) { |
|
| 81 | return null; |
|
| 82 | } |
|
| 83 | $this->mRedirectTarget = Title::makeTitle( NS_FILE, $to ); |
|
| 84 | return $this->mRedirectTarget; |
|
| 85 | } |
|
| 86 | ||
| 87 | /** |
|
| 88 | * @return bool|mixed|Title |
|
| @@ 90-101 (lines=12) @@ | ||
| 87 | /** |
|
| 88 | * @return bool|mixed|Title |
|
| 89 | */ |
|
| 90 | public function followRedirect() { |
|
| 91 | $this->loadFile(); |
|
| 92 | if ( $this->mFile->isLocal() ) { |
|
| 93 | return parent::followRedirect(); |
|
| 94 | } |
|
| 95 | $from = $this->mFile->getRedirected(); |
|
| 96 | $to = $this->mFile->getName(); |
|
| 97 | if ( $from == $to ) { |
|
| 98 | return false; |
|
| 99 | } |
|
| 100 | return Title::makeTitle( NS_FILE, $to ); |
|
| 101 | } |
|
| 102 | ||
| 103 | /** |
|
| 104 | * @return bool |
|