* (bug 2597) Don't crash when undeleting an image description page
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 29 Jun 2005 01:42:37 +0000 (01:42 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 29 Jun 2005 01:42:37 +0000 (01:42 +0000)
Added a backtrace on Image constructor given bogus title for debugging aid

includes/Image.php
includes/SpecialUndelete.php

index 37f02d9..2dfd606 100644 (file)
@@ -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() ) ;
index 736b828..51b8083 100644 (file)
@@ -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;