Refactor core from Title::getLinkUrl to Title::getLinkURL to match Title's getLocalUR...
authorDaniel Friesen <dantman@users.mediawiki.org>
Thu, 10 Nov 2011 03:27:55 +0000 (03:27 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Thu, 10 Nov 2011 03:27:55 +0000 (03:27 +0000)
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
includes/FakeTitle.php
includes/Linker.php
includes/Title.php
includes/media/MediaTransformOutput.php

index 0b48c10..0462a2b 100644 (file)
@@ -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 = "<a href=\"$curUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['cur']}</a>";
                        }
                        $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 = "<a href=\"$diffUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['diff']}</a>";
                        $curLink = "<a href=\"$curUrl\" tabindex=\"{$baseRC->counter}\">{$this->message['cur']}</a>";
                }
index 515ff38..88ee808 100644 (file)
@@ -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(); }
index ff9af75..5608eb2 100644 (file)
@@ -254,7 +254,7 @@ class Linker {
                        $query['action'] = 'edit';
                        $query['redlink'] = '1';
                }
-               $ret = $target->getLinkUrl( $query );
+               $ret = $target->getLinkURL( $query );
                wfProfileOut( __METHOD__ );
                return $ret;
        }
index 22148f6..d4abcbb 100644 (file)
@@ -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 );
index f170bb9..1e1b459 100644 (file)
@@ -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'] ) ) {