From 74e9732dae6b8c08f2f134808eb70f7bfaa90e1a Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sat, 13 Jun 2009 13:41:48 +0000 Subject: [PATCH] * deprecated makeMediaLink() to makeMediaLinkObj * 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 | 7 ++++++- includes/specials/SpecialUpload.php | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/includes/Linker.php b/includes/Linker.php index 3161cbfeec..2b6e674620 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -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 diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 3a9b36c6d6..6afc06e2ae 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -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 ); -- 2.20.1