From 32b4dd8a770d79a2c115378c00f72ac66b12db89 Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Thu, 10 Nov 2011 03:27:55 +0000 Subject: [PATCH] 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. --- includes/ChangesList.php | 6 +++--- includes/FakeTitle.php | 2 +- includes/Linker.php | 2 +- includes/Title.php | 2 +- includes/media/MediaTransformOutput.php | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 0b48c103da..0462a2b303 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -706,13 +706,13 @@ class EnhancedChangesList extends ChangesList { if ( $type != RC_NEW ) { $curLink = $this->message['cur']; } else { - $curUrl = htmlspecialchars( $rc->getTitle()->getLinkUrl( $querycur ) ); + $curUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querycur ) ); $curLink = "counter}\">{$this->message['cur']}"; } $diffLink = $this->message['diff']; } else { - $diffUrl = htmlspecialchars( $rc->getTitle()->getLinkUrl( $querydiff ) ); - $curUrl = htmlspecialchars( $rc->getTitle()->getLinkUrl( $querycur ) ); + $diffUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querydiff ) ); + $curUrl = htmlspecialchars( $rc->getTitle()->getLinkURL( $querycur ) ); $diffLink = "counter}\">{$this->message['diff']}"; $curLink = "counter}\">{$this->message['cur']}"; } diff --git a/includes/FakeTitle.php b/includes/FakeTitle.php index 515ff387e1..88ee8084b6 100644 --- a/includes/FakeTitle.php +++ b/includes/FakeTitle.php @@ -31,7 +31,7 @@ class FakeTitle extends Title { function getPrefixedURL() { $this->error(); } function getFullURL( $query = '', $variant = false ) { $this->error(); } function getLocalURL( $query = '', $variant = false ) { $this->error(); } - function getLinkUrl( $query = array(), $variant = false ) { $this->error(); } + function getLinkURL( $query = array(), $variant = false ) { $this->error(); } function escapeLocalURL( $query = '' ) { $this->error(); } function escapeFullURL( $query = '' ) { $this->error(); } function getInternalURL( $query = '', $variant = false ) { $this->error(); } diff --git a/includes/Linker.php b/includes/Linker.php index ff9af75d4f..5608eb2511 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -254,7 +254,7 @@ class Linker { $query['action'] = 'edit'; $query['redlink'] = '1'; } - $ret = $target->getLinkUrl( $query ); + $ret = $target->getLinkURL( $query ); wfProfileOut( __METHOD__ ); return $ret; } diff --git a/includes/Title.php b/includes/Title.php index 22148f60ce..d4abcbb2a3 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -959,7 +959,7 @@ class Title { * for anonymous users). * @return String the URL */ - public function getLinkUrl( $query = array(), $variant = false ) { + public function getLinkURL( $query = array(), $variant = false ) { wfProfileIn( __METHOD__ ); if ( $this->isExternal() ) { $ret = $this->getFullURL( $query ); diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index f170bb9d6d..1e1b4598be 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -185,7 +185,7 @@ class ThumbnailImage extends MediaTransformOutput { } elseif ( !empty( $options['custom-title-link'] ) ) { $title = $options['custom-title-link']; $linkAttribs = array( - 'href' => $title->getLinkUrl(), + 'href' => $title->getLinkURL(), 'title' => empty( $options['title'] ) ? $title->getFullText() : $options['title'] ); } elseif ( !empty( $options['desc-link'] ) ) { -- 2.20.1