From fa813bd470e8209045f38b3c78fa74f782a63f4f Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Mon, 10 Jul 2006 19:49:22 +0000 Subject: [PATCH] Fix #6622: image::newFromTitle deprecated but still used --- RELEASE-NOTES | 1 + includes/CategoryPage.php | 6 ++++-- includes/ExternalEdit.php | 2 +- includes/Image.php | 8 -------- includes/Parser.php | 2 +- includes/SpecialNewimages.php | 2 +- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index aa5e64b84a..f67cbfb25f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -47,6 +47,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN cache object. * (bug 6299) Maintain parser's revision ID across recursive calls to fix {{REVISIONID}} when Cite extension is used +* (bug 6622) Removed deprecated function image::newFromTitle == Languages updated == diff --git a/includes/CategoryPage.php b/includes/CategoryPage.php index 53d69971b9..440f41c24b 100644 --- a/includes/CategoryPage.php +++ b/includes/CategoryPage.php @@ -124,11 +124,13 @@ class CategoryPage extends Article { array_push( $children_start_char, $wgContLang->convert( $sortkey ) ) ; } elseif( $showGallery && $title->getNamespace() == NS_IMAGE ) { // Show thumbnails of categorized images, in a separate chunk + $anImage = new Image($title); if( $flip ) { - $ig->insert( Image::newFromTitle( $title ) ); + $ig->insert( $anImage ); } else { - $ig->add( Image::newFromTitle( $title ) ); + $ig->add( $anImage ); } + unset($anImage); } else { // Page in this category array_push( $articles, $sk->makeSizeLinkObj( $x->page_len, $title, $wgContLang->convert( $title->getPrefixedText() ) ) ) ; diff --git a/includes/ExternalEdit.php b/includes/ExternalEdit.php index 21f632ec69..14b55fdbde 100644 --- a/includes/ExternalEdit.php +++ b/includes/ExternalEdit.php @@ -48,7 +48,7 @@ class ExternalEdit { $extension="wiki"; } elseif($this->mMode=="file") { $type="Edit file"; - $image = Image::newFromTitle( $this->mTitle ); + $image = new Image( $this->mTitle ); $img_url = $image->getURL(); if(strpos($img_url,"://")) { $url = $img_url; diff --git a/includes/Image.php b/includes/Image.php index fd0f8a3ccb..c5cf3e9e57 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -66,14 +66,6 @@ class Image } } - /** - * Obsolete factory function, use constructor - * @deprecated - */ - function newFromTitle( $title ) { - return new Image( $title ); - } - function Image( $title ) { if( !is_object( $title ) ) { throw new MWException( 'Image constructor given bogus title.' ); diff --git a/includes/Parser.php b/includes/Parser.php index 9f60030da2..8a6314dfe7 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -1634,7 +1634,7 @@ class Parser $s .= $this->makeKnownLinkHolder( $nt, $text, '', $trail, $prefix ); continue; } elseif( $ns == NS_IMAGE ) { - $img = Image::newFromTitle( $nt ); + $img = new Image( $nt ); if( $img->exists() ) { // Force a blue link if the file exists; may be a remote // upload on the shared repository, and we want to see its diff --git a/includes/SpecialNewimages.php b/includes/SpecialNewimages.php index 976611a360..1bd3e4cb8a 100644 --- a/includes/SpecialNewimages.php +++ b/includes/SpecialNewimages.php @@ -130,7 +130,7 @@ function wfSpecialNewimages( $par, $specialPage ) { $ut = $s->img_user_text; $nt = Title::newFromText( $name, NS_IMAGE ); - $img = Image::newFromTitle( $nt ); + $img = new Image( $nt ); $ul = $sk->makeLinkObj( Title::makeTitle( NS_USER, $ut ), $ut ); $gallery->add( $img, "$ul
\n".$wgLang->timeanddate( $s->img_timestamp, true )."
\n" ); -- 2.20.1