Index: trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php |
— | — | @@ -89,8 +89,9 @@ |
90 | 90 | } |
91 | 91 | |
92 | 92 | protected function formatItem( $name ) { |
93 | | - $title = Title::newFromText( $name ); |
| 93 | + $title = TItle::newFromText( $name ); |
94 | 94 | if( $title ) { |
| 95 | + $title = $this->_checkRedirect( $title ); |
95 | 96 | if( $this->_seen( $title ) ) { |
96 | 97 | return false; |
97 | 98 | } |
— | — | @@ -115,6 +116,16 @@ |
116 | 117 | return $item; |
117 | 118 | } |
118 | 119 | |
| 120 | + protected function _checkRedirect( $title ) { |
| 121 | + $art = new Article( $title ); |
| 122 | + $target = $art->getRedirectTarget(); |
| 123 | + if( $target ) { |
| 124 | + return $target; |
| 125 | + } else { |
| 126 | + return $title; |
| 127 | + } |
| 128 | + } |
| 129 | + |
119 | 130 | protected function _seen( $title ) { |
120 | 131 | $name = $title->getPrefixedText(); |
121 | 132 | if( isset( $this->mSeen[$name] ) ) { |