r102620 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102619‎ | r102620 | r102621 >
Date:03:27, 10 November 2011
Author:dantman
Status:ok
Tags:
Comment:
Refactor core from Title::getLinkUrl to Title::getLinkURL to match Title's getLocalURL and getFullURL.
This shouldn't cause any back or forward compat issues since php treats method names as case-insensitive. So this change shouldn't break any old extensions, and extensions are free to start using getLinkURL and won't have any issue breaking with old versions of MediaWiki.
Modified paths:
  • /trunk/phase3/includes/ChangesList.php (modified) (history)
  • /trunk/phase3/includes/FakeTitle.php (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/media/MediaTransformOutput.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -254,7 +254,7 @@
255255 $query['action'] = 'edit';
256256 $query['redlink'] = '1';
257257 }
258 - $ret = $target->getLinkUrl( $query );
 258+ $ret = $target->getLinkURL( $query );
259259 wfProfileOut( __METHOD__ );
260260 return $ret;
261261 }
Index: trunk/phase3/includes/media/MediaTransformOutput.php
@@ -185,7 +185,7 @@
186186 } elseif ( !empty( $options['custom-title-link'] ) ) {
187187 $title = $options['custom-title-link'];
188188 $linkAttribs = array(
189 - 'href' => $title->getLinkUrl(),
 189+ 'href' => $title->getLinkURL(),
190190 'title' => empty( $options['title'] ) ? $title->getFullText() : $options['title']
191191 );
192192 } elseif ( !empty( $options['desc-link'] ) ) {
Index: trunk/phase3/includes/ChangesList.php
@@ -706,13 +706,13 @@
707707 if ( $type != RC_NEW ) {
708708 $curLink = $this->message['cur'];
709709 } else {
710 - $curUrl = htmlspecialchars( $rc->getTitle()->getLinkUrl( $querycur ) );
 710+ $curUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querycur ) );
711711 $curLink = "<a href=\"$curUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['cur']}</a>";
712712 }
713713 $diffLink = $this->message['diff'];
714714 } else {
715 - $diffUrl = htmlspecialchars( $rc->getTitle()->getLinkUrl( $querydiff ) );
716 - $curUrl = htmlspecialchars( $rc->getTitle()->getLinkUrl( $querycur ) );
 715+ $diffUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querydiff ) );
 716+ $curUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querycur ) );
717717 $diffLink = "<a href=\"$diffUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['diff']}</a>";
718718 $curLink = "<a href=\"$curUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['cur']}</a>";
719719 }
Index: trunk/phase3/includes/Title.php
@@ -959,7 +959,7 @@
960960 * for anonymous users).
961961 * @return String the URL
962962 */
963 - public function getLinkUrl( $query = array(), $variant = false ) {
 963+ public function getLinkURL( $query = array(), $variant = false ) {
964964 wfProfileIn( __METHOD__ );
965965 if ( $this->isExternal() ) {
966966 $ret = $this->getFullURL( $query );
Index: trunk/phase3/includes/FakeTitle.php
@@ -31,7 +31,7 @@
3232 function getPrefixedURL() { $this->error(); }
3333 function getFullURL( $query = '', $variant = false ) { $this->error(); }
3434 function getLocalURL( $query = '', $variant = false ) { $this->error(); }
35 - function getLinkUrl( $query = array(), $variant = false ) { $this->error(); }
 35+ function getLinkURL( $query = array(), $variant = false ) { $this->error(); }
3636 function escapeLocalURL( $query = '' ) { $this->error(); }
3737 function escapeFullURL( $query = '' ) { $this->error(); }
3838 function getInternalURL( $query = '', $variant = false ) { $this->error(); }

Status & tagging log