From: Brion Vibber Date: Wed, 29 Jun 2005 01:42:37 +0000 (+0000) Subject: * (bug 2597) Don't crash when undeleting an image description page X-Git-Tag: 1.5.0beta2~138 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=7d6ea71a6ae94be9c6fb46cfd1ce8b67adefc3d9;p=lhc%2Fweb%2Fwiklou.git * (bug 2597) Don't crash when undeleting an image description page Added a backtrace on Image constructor given bogus title for debugging aid --- 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;