From 41d064c9b2bb10c02232bfe1c2519f82fe46aa67 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Tue, 6 Dec 2005 22:33:47 +0000 Subject: [PATCH] Avoid FATAL ERROR when creating thumbnail of non-existing image --- RELEASE-NOTES | 1 + includes/Linker.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2dac2a04be..0ad4ce6931 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -299,6 +299,7 @@ fully support the editing toolbar, but was found to be too confusing. get a blue link even if there's no local description page * (bug 4169) Use $wgLegalTitleChars in pipe trick conversions * (bug 4170) Decode HTML character escapes in sort key +* Avoid FATAL ERROR when creating thumbnail of non-existing image === Caveats === diff --git a/includes/Linker.php b/includes/Linker.php index 33d45da4be..f949637864 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -480,6 +480,8 @@ class Linker { if ( $img->exists() ) { $width = $img->getWidth(); $height = $img->getHeight(); + } else { + return $this->makeBrokenLinkObj( $img->getTitle() ); } if ( 0 == $width || 0 == $height ) { $width = $height = 200; -- 2.20.1