r51464 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51463‎ | r51464 | r51465 >
Date:11:30, 4 June 2009
Author:jojo
Status:deferred
Tags:
Comment:
use Title::newFromText() instead of Title::newFromUrl()
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)
  • /trunk/extensions/Collection/Collection.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.hooks.php
@@ -158,7 +158,7 @@
159159 // we need to re-construct a title object from the request, because
160160 // the "subpage" (i.e. "par") part has been stripped off by SpecialPage.php
161161 // in $wgTitle.
162 - $origTitle = Title::newFromUrl($wgRequest->getVal('title'));
 162+ $origTitle = Title::newFromText($wgRequest->getVal('title'));
163163 if( !is_null( $origTitle )
164164 && $origTitle->getLocalUrl() == SkinTemplate::makeSpecialUrl( 'Book' ) ) {
165165 return;
Index: trunk/extensions/Collection/Collection.body.php
@@ -57,7 +57,7 @@
5858 }
5959 $title_url = $wgRequest->getVal( 'arttitle', '' );
6060 $oldid = $wgRequest->getInt( 'oldid', 0 );
61 - $title = Title::newFromURL( $title_url );
 61+ $title = Title::newFromText( $title_url );
6262 $this->addArticle( $title, $oldid );
6363 if ( $oldid == 0 ) {
6464 $redirectURL = $title->getFullURL();
@@ -70,7 +70,7 @@
7171 case 'remove_article/':
7272 $title_url = $wgRequest->getVal( 'arttitle', '' );
7373 $oldid = $wgRequest->getInt( 'oldid', 0 );
74 - $title = Title::newFromURL( $title_url );
 74+ $title = Title::newFromText( $title_url );
7575 self::removeArticle( $title, $oldid );
7676 if ( $oldid == 0 ) {
7777 $redirectURL = $title->getFullURL();

Status & tagging log