* deprecated makeMediaLink() to makeMediaLinkObj
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Sat, 13 Jun 2009 13:41:48 +0000 (13:41 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Sat, 13 Jun 2009 13:41:48 +0000 (13:41 +0000)
* add FIXME where I was not able to replace a deprecated method
* add doxygen @deprecated where wfDeprecated() was present, but not the doc

Should conclude replacing or tagging remaining deprecated Linker::make*Link*() in core. Linking to r51559 for code review

includes/Linker.php
includes/specials/SpecialUpload.php

index 3161cbf..2b6e674 100644 (file)
@@ -337,6 +337,7 @@ class Linker {
                global $wgUser;
                $threshold = intval( $wgUser->getOption( 'stubthreshold' ) );
                $colour = ( $size < $threshold ) ? 'stub' : '';
+               // FIXME: replace deprecated makeColouredLinkObj by link()
                return $this->makeColouredLinkObj( $nt, $colour, $text, $query, $trail, $prefix );
        }
 
@@ -1046,7 +1047,8 @@ class Linker {
                if( preg_match( '/^' . $medians . '(.*)$/i', $match[1], $submatch ) ) {
                        # Media link; trail not supported.
                        $linkRegexp = '/\[\[(.*?)\]\]/';
-                       $thelink = $this->makeMediaLink( $submatch[1], "", $text );
+                       $title = Title::makeTitleSafe( NS_FILE, $submatch[1] );
+                       $thelink = $this->makeMediaLinkObj( $title, $text );
                } else {
                        # Other kind of link
                        if( preg_match( $wgContLang->linkTrail(), $match[4], $submatch ) ) {
@@ -1740,6 +1742,7 @@ class Linker {
                } else $style = '';
                return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix, '', $style );
        }
+
        /** Obsolete alias */
        function makeImage( $url, $alt = '' ) {
                wfDeprecated( __METHOD__ );
@@ -1795,6 +1798,7 @@ class Linker {
         * Used to generate section edit links that point to "other" pages
         * (sections that are really part of included pages).
         *
+        * @deprecated use Linker::doEditSectionLink()
         * @param $title Title string.
         * @param $section Integer: section number.
         */
@@ -1805,6 +1809,7 @@ class Linker {
        }
 
        /**
+        * @deprecated use Linker::doEditSectionLink()
         * @param $nt Title object.
         * @param $section Integer: section number.
         * @param $hint Link String: title, or default if omitted or empty
index 3a9b36c..6afc06e 100644 (file)
@@ -634,6 +634,7 @@ class UploadForm {
                if( $file->exists() ) {
                        $dlink = $sk->linkKnown( $file->getTitle() );
                        if ( $file->allowInlineDisplay() ) {
+                               // FIXME: replace deprecated makeImageLinkObj by link()
                                $dlink2 = $sk->makeImageLinkObj( $file->getTitle(), wfMsgExt( 'fileexists-thumb', 'parseinline' ),
                                        $file->getName(), $align, array(), false, true );
                        } elseif ( !$file->allowInlineDisplay() && $file->isSafeFile() ) {
@@ -659,6 +660,7 @@ class UploadForm {
                        # It's not forbidden but in 99% it makes no sense to upload the same filename with uppercase extension
                        $dlink = $sk->linkKnown( $nt_lc );
                        if ( $file_lc->allowInlineDisplay() ) {
+                               // FIXME: replace deprecated makeImageLinkObj by link()
                                $dlink2 = $sk->makeImageLinkObj( $nt_lc, wfMsgExt( 'fileexists-thumb', 'parseinline' ),
                                        $nt_lc->getText(), $align, array(), false, true );
                        } elseif ( !$file_lc->allowInlineDisplay() && $file_lc->isSafeFile() ) {
@@ -684,6 +686,7 @@ class UploadForm {
                                # Check if an image without leading '180px-' (or similiar) exists
                                $dlink = $sk->linkKnown( $nt_thb );
                                if ( $file_thb->allowInlineDisplay() ) {
+                                       // FIXME: replace deprecated makeImageLinkObj by link()
                                        $dlink2 = $sk->makeImageLinkObj( $nt_thb,
                                                wfMsgExt( 'fileexists-thumb', 'parseinline' ),
                                                $nt_thb->getText(), $align, array(), false, true );