r46295 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46294‎ | r46295 | r46296 >
Date:22:57, 26 January 2009
Author:brion
Status:deferred
Tags:
Comment:
Reverting r46131 "OpenSearchXml extension: (bug 17142) action=opensearch shouldn't resolve redirects in XML mode"
Major regression in attractiveness and usability; the feature that was removed was not a bug.
Modified paths:
  • /trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenSearchXml/ApiOpenSearchXml.php
@@ -89,8 +89,9 @@
9090 }
9191
9292 protected function formatItem( $name ) {
93 - $title = Title::newFromText( $name );
 93+ $title = TItle::newFromText( $name );
9494 if( $title ) {
 95+ $title = $this->_checkRedirect( $title );
9596 if( $this->_seen( $title ) ) {
9697 return false;
9798 }
@@ -115,6 +116,16 @@
116117 return $item;
117118 }
118119
 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+
119130 protected function _seen( $title ) {
120131 $name = $title->getPrefixedText();
121132 if( isset( $this->mSeen[$name] ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r46341API: (bug 17142) Add redirects parameter to action=opensearch to control redi...catrope14:43, 27 January 2009
r46379Pulling back r46341 and r46342 for now "API: (bug 17142) Add redirects parame...brion20:39, 27 January 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r46131OpenSearchXml extension: (bug 17142) action=opensearch shouldn't resolve redi...catrope12:04, 24 January 2009

Status & tagging log