r62452 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62451‎ | r62452 | r62453 >
Date:23:58, 13 February 2010
Author:platonides
Status:ok
Tags:
Comment:
Follow up r62436 comments.
s/Title::newFromUrl/Title::newFromURL/
All these usages should be reviewed. Make it easy to grep using the canonical form.
Additionally fix the typo.
Modified paths:
  • /trunk/extensions/Contributors/Contributors.page.php (modified) (history)
  • /trunk/extensions/Duplicator/Duplicator.page.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/ReviewedVersions_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php (modified) (history)
  • /trunk/extensions/Nuke/SpecialNuke_body.php (modified) (history)
  • /trunk/extensions/Oversight/HideRevision_body.php (modified) (history)
  • /trunk/extensions/ParserFunctions/ParserFunctions_body.php (modified) (history)
  • /trunk/extensions/ReaderFeedback/specialpages/RatingHistory_body.php (modified) (history)
  • /trunk/extensions/ReaderFeedback/specialpages/ReaderFeedback_body.php (modified) (history)
  • /trunk/extensions/Review/Review.php (modified) (history)
  • /trunk/extensions/SpecialFileList/SpecialFilelist.php (modified) (history)
  • /trunk/extensions/WebDAV/WebDavServer.php (modified) (history)
  • /trunk/extensions/catfeed/catfeed.php (modified) (history)
  • /trunk/phase3/includes/parser/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialListfiles.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialNewimages.php (modified) (history)
  • /trunk/phase3/maintenance/importTextFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/importTextFile.php
@@ -23,7 +23,7 @@
2424 if( is_file( $filename ) ) {
2525
2626 $title = isset( $options['title'] ) ? $options['title'] : titleFromFilename( $filename );
27 - $title = Title::newFromUrl( $title );
 27+ $title = Title::newFromURL( $title );
2828
2929 if( is_object( $title ) ) {
3030
Index: trunk/phase3/includes/parser/CoreParserFunctions.php
@@ -170,7 +170,7 @@
171171 # and the variable will fail. If we can't get a decent title from the first
172172 # attempt, url-decode and try for a second.
173173 if( is_null( $title ) )
174 - $title = Title::newFromUrl( urldecode( $s ) );
 174+ $title = Title::newFromURL( urldecode( $s ) );
175175 if( !is_null( $title ) ) {
176176 # Convert NS_MEDIA -> NS_FILE
177177 if( $title->getNamespace() == NS_MEDIA ) {
Index: trunk/phase3/includes/specials/SpecialListfiles.php
@@ -34,7 +34,7 @@
3535 }
3636 $search = $wgRequest->getText( 'ilsearch' );
3737 if ( $search != '' && !$wgMiserMode ) {
38 - $nt = Title::newFromUrl( $search );
 38+ $nt = Title::newFromURL( $search );
3939 if( $nt ) {
4040 $dbr = wfGetDB( DB_SLAVE );
4141 $this->mQueryConds = array( 'LOWER(img_name)' . $dbr->buildLike( $dbr->anyString(),
Index: trunk/phase3/includes/specials/SpecialNewimages.php
@@ -67,7 +67,7 @@
6868 $where = array();
6969 $searchpar = array();
7070 if ( $wpIlMatch != '' && !$wgMiserMode) {
71 - $nt = Title::newFromUrl( $wpIlMatch );
 71+ $nt = Title::newFromURL( $wpIlMatch );
7272 if( $nt ) {
7373 $where[] = 'LOWER(img_name) ' . $dbr->buildLike( $dbr->anyString(), strtolower( $nt->getDBkey() ), $dbr->anyString() );
7474 $searchpar['wpIlMatch'] = $wpIlMatch;
Index: trunk/extensions/SpecialFileList/SpecialFilelist.php
@@ -108,7 +108,7 @@
109109 $where = array();
110110 $searchpar = '';
111111 if ( $params['match'] != '' ) {
112 - $nt = Title::newFromUrl( $params['match'] );
 112+ $nt = Title::newFromURL( $params['match'] );
113113 if($nt ) {
114114 $m = $this->dbr->strencode( strtolower( $nt->getDBkey() ) );
115115 $m = str_replace( '%', "\\%", $m );
Index: trunk/extensions/Oversight/HideRevision_body.php
@@ -29,7 +29,7 @@
3030 $this->mRevisions = (array)$wgRequest->getIntArray( 'revision' );
3131
3232 // For deleted/archived revisions
33 - $this->mTarget = Title::newFromUrl( $wgRequest->getVal( 'target' ) );
 33+ $this->mTarget = Title::newFromURL( $wgRequest->getVal( 'target' ) );
3434 $this->mTimestamps = (array)$wgRequest->getArray( 'timestamp' );
3535 if( is_null( $this->mTarget ) ) {
3636 // title and timestamps must go together
@@ -388,7 +388,7 @@
389389 function showList( $page, $user, $offender ) {
390390 global $wgOut, $wgScript, $wgTitle;
391391
392 - $title = Title::newFromUrl( $page );
 392+ $title = Title::newFromURL( $page );
393393 $u = User::newFromName( $user );
394394 $page = $title ? $page : ''; // blank invalid titles
395395
Index: trunk/extensions/WebDAV/WebDavServer.php
@@ -146,7 +146,7 @@
147147
148148 while ( ( $result = $dbr->fetchRow( $results ) ) !== false ) {
149149 # TODO: Should maybe not be using page_title as URL component, but it's currently what we do elsewhere
150 - $title = Title::newFromUrl( $result[0] );
 150+ $title = Title::newFromURL( $result[0] );
151151
152152 $response = array();
153153 $response['path'] = 'webdav.php/' . $result[0];
@@ -223,7 +223,7 @@
224224
225225 while ( ( $result = $dbr->fetchRow( $results ) ) !== false ) {
226226 # TODO: Should maybe not be using page_title as URL component, but it's currently what we do elsewhere
227 - $title = Title::newFromUrl( $result[0] );
 227+ $title = Title::newFromURL( $result[0] );
228228
229229 $response = array();
230230 $response['path'] = 'deltav.php/bc/' . $revisionId . '/' . $result[0];
@@ -310,7 +310,7 @@
311311 $revisionId = array_shift( $this->pathComponents );
312312
313313 if ( $pathComponent == 'bc' ) {
314 - $title = Title::newFromUrl( implode( '/', $this->pathComponents ) );
 314+ $title = Title::newFromURL( implode( '/', $this->pathComponents ) );
315315 if (!isset( $title )) {
316316 $title = Title::newMainPage();
317317 }
@@ -328,7 +328,7 @@
329329 $revisionId = $serverOptions['label'];
330330 }
331331
332 - $title = Title::newFromUrl( implode( '/', $this->pathComponents ) );
 332+ $title = Title::newFromURL( implode( '/', $this->pathComponents ) );
333333 if (!isset( $title )) {
334334 $title = Title::newMainPage();
335335 }
@@ -391,7 +391,7 @@
392392 return;
393393 }
394394
395 - $title = Title::newFromUrl( implode( '/', $this->pathComponents ) );
 395+ $title = Title::newFromURL( implode( '/', $this->pathComponents ) );
396396 if (!isset( $title )) {
397397 $title = Title::newMainPage();
398398 }
@@ -426,7 +426,7 @@
427427 return;
428428 }
429429
430 - $title = Title::newFromUrl( implode( '/', $this->pathComponents ) );
 430+ $title = Title::newFromURL( implode( '/', $this->pathComponents ) );
431431 if (!isset( $title )) {
432432 $title = Title::newMainPage();
433433 }
Index: trunk/extensions/Duplicator/Duplicator.page.php
@@ -133,9 +133,9 @@
134134 private function setOptions( &$request, $title ) {
135135 $source = $request->getText( 'source' );
136136 $this->source = $source ? $source : ( $title ? $title : '' );
137 - $this->sourceTitle = Title::newFromUrl( $this->source );
 137+ $this->sourceTitle = Title::newFromURL( $this->source );
138138 $this->dest = $request->getText( 'dest', '' );
139 - $this->destTitle = Title::newFromUrl( $this->dest );
 139+ $this->destTitle = Title::newFromURL( $this->dest );
140140 $this->talk = $request->getCheck( 'talk' );
141141 }
142142
Index: trunk/extensions/ParserFunctions/ParserFunctions_body.php
@@ -321,8 +321,8 @@
322322 function ifexistCommon( &$parser, $frame, $titletext = '', $then = '', $else = '' ) {
323323 global $wgContLang;
324324 $title = Title::newFromText( $titletext );
325 - if( is_null( $title ) ) # It my be urlencoded (bug 14779)
326 - $title = Title::newFromUrl( urldecode( $titletext ) );
 325+ if( is_null( $title ) ) # It may be urlencoded (bug 14779)
 326+ $title = Title::newFromURL( urldecode( $titletext ) );
327327
328328 $wgContLang->findVariantLink( $titletext, $title, true );
329329 if ( $title ) {
Index: trunk/extensions/Review/Review.php
@@ -777,7 +777,7 @@
778778
779779 if ( $page_id == 0 ) {
780780 if( $par != ''){
781 - $title = Title::newFromUrl($par);
 781+ $title = Title::newFromURL($par);
782782 $page_id = $title->getArticleID();
783783 }
784784 else{
Index: trunk/extensions/Contributors/Contributors.page.php
@@ -194,7 +194,7 @@
195195 */
196196 private function determineTarget( &$request, $override ) {
197197 $target = $request->getText( 'target', $override );
198 - $this->target = Title::newFromUrl( $target );
 198+ $this->target = Title::newFromURL( $target );
199199 }
200200
201201 /**
Index: trunk/extensions/Nuke/SpecialNuke_body.php
@@ -140,7 +140,7 @@
141141
142142 function doDelete( $pages, $reason ) {
143143 foreach( $pages as $page ) {
144 - $title = Title::newFromUrl( $page );
 144+ $title = Title::newFromURL( $page );
145145 $file = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false;
146146 if ( $file ) {
147147 $oldimage = null; // Must be passed by reference
Index: trunk/extensions/FlaggedRevs/specialpages/Stabilization_body.php
@@ -92,7 +92,7 @@
9393 */
9494 public function handleParams() {
9595 # Our target page
96 - $this->page = Title::newFromUrl( $this->target );
 96+ $this->page = Title::newFromURL( $this->target );
9797 # We need a page...
9898 if ( is_null( $this->page ) ) {
9999 return false; // can't continue
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -49,7 +49,7 @@
5050 }
5151 $this->setHeaders();
5252 # Our target page
53 - $this->page = Title::newFromUrl( $wgRequest->getVal( 'target' ) );
 53+ $this->page = Title::newFromURL( $wgRequest->getVal( 'target' ) );
5454 if ( is_null( $this->page ) ) {
5555 $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
5656 return;
@@ -196,7 +196,7 @@
197197 switch( $par )
198198 {
199199 case "target":
200 - $form->page = Title::newFromUrl( $val );
 200+ $form->page = Title::newFromURL( $val );
201201 if ( is_null( $form->page ) || !FlaggedRevs::inReviewNamespace( $form->page ) ) {
202202 return '<err#>' . wfMsgExt( 'revreview-failed', 'parseinline' );
203203 }
Index: trunk/extensions/FlaggedRevs/specialpages/ReviewedVersions_body.php
@@ -17,7 +17,7 @@
1818 $this->skin = $wgUser->getSkin();
1919 # Our target page
2020 $this->target = $wgRequest->getText( 'page' );
21 - $this->page = Title::newFromUrl( $this->target );
 21+ $this->page = Title::newFromURL( $this->target );
2222 # Revision ID
2323 $this->oldid = $wgRequest->getVal( 'oldid' );
2424 $this->oldid = ( $this->oldid == 'best' ) ? 'best' : intval( $this->oldid );
Index: trunk/extensions/ReaderFeedback/specialpages/RatingHistory_body.php
@@ -32,7 +32,7 @@
3333 $this->doPurge = ('purge' === $wgRequest->getVal( 'action' ) && $wgUser->isAllowed('purge'));
3434 # Our target page
3535 $this->target = $wgRequest->getText( 'target' );
36 - $this->page = Title::newFromUrl( $this->target );
 36+ $this->page = Title::newFromURL( $this->target );
3737 # We need a page...
3838 if( is_null($this->page) ) {
3939 $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
Index: trunk/extensions/ReaderFeedback/specialpages/ReaderFeedback_body.php
@@ -41,7 +41,7 @@
4242 }
4343 $this->setHeaders();
4444 # Our target page
45 - $this->page = Title::newFromUrl( $wgRequest->getVal( 'target' ) );
 45+ $this->page = Title::newFromURL( $wgRequest->getVal( 'target' ) );
4646 if( is_null($this->page) ) {
4747 $wgOut->showErrorPage('notargettitle', 'notargettext' );
4848 return;
@@ -123,7 +123,7 @@
124124 switch( $par )
125125 {
126126 case "target":
127 - $form->page = Title::newFromUrl( $val );
 127+ $form->page = Title::newFromURL( $val );
128128 if( is_null($form->page) || !ReaderFeedback::isPageRateable( $form->page ) ) {
129129 return '<err#>' . wfMsg('formerror');
130130 }
Index: trunk/extensions/catfeed/catfeed.php
@@ -294,7 +294,7 @@
295295
296296 # Add only valid title objects
297297 foreach ( $iptitles as $title ) {
298 - $addtitle = Title::newFromUrl($title);
 298+ $addtitle = Title::newFromURL($title);
299299 if(get_class($addtitle)=="title") {
300300 $dbtitles[] = $addtitle;
301301 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62436(Bug 14779) {{#ifexist}} does not recognise URL encoded filenames...platonides15:08, 13 February 2010

Status & tagging log