From 7d6ea71a6ae94be9c6fb46cfd1ce8b67adefc3d9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 29 Jun 2005 01:42:37 +0000 Subject: [PATCH] * (bug 2597) Don't crash when undeleting an image description page Added a backtrace on Image constructor given bogus title for debugging aid --- includes/Image.php | 3 +++ includes/SpecialUndelete.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/Image.php b/includes/Image.php index 37f02d9f02..2dfd6069ae 100644 --- a/includes/Image.php +++ b/includes/Image.php @@ -69,6 +69,9 @@ class Image function Image( $title ) { global $wgShowEXIF; + if( !is_object( $title ) ) { + wfDebugDieBacktrace( 'Image constructor given bogus title.' ); + } $this->title =& $title; $this->name = $title->getDBkey(); $this->metadata = serialize ( array() ) ; diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index 736b828216..51b8083f7a 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -451,7 +451,7 @@ class UndeleteForm { if (NS_IMAGE == $this->mTargetObj->getNamespace()) { /* refresh image metadata cache */ - new Image( $this->mTargetObj->getText(), true ); + new Image( $this->mTargetObj ); } return true; -- 2.20.1