From: Alexandre Emsenhuber Date: Thu, 12 May 2011 18:06:57 +0000 (+0000) Subject: Removed dead code path since r27312: $revision cannot be null if $restored is non... X-Git-Tag: 1.31.0-rc.0~30272 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=f7bda8ce36dc2ac361eafa27369c44329b30b978;p=lhc%2Fweb%2Fwiklou.git Removed dead code path since r27312: $revision cannot be null if $restored is non-zero --- diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index dd66ddc871..2ed649505b 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -515,33 +515,28 @@ class PageArchive { __METHOD__ ); // Was anything restored at all? - if( $restored == 0 ) + if ( $restored == 0 ) { return 0; + } - if( $revision ) { - // Attach the latest revision to the page... - $wasnew = $article->updateIfNewerOn( $dbw, $revision, $previousRevId ); - if( $newid || $wasnew ) { - // Update site stats, link tables, etc - $article->createUpdates( $revision ); - } - - if( $newid ) { - wfRunHooks( 'ArticleUndelete', array( &$this->title, true, $comment ) ); - Article::onArticleCreate( $this->title ); - } else { - wfRunHooks( 'ArticleUndelete', array( &$this->title, false, $comment ) ); - Article::onArticleEdit( $this->title ); - } + // Attach the latest revision to the page... + $wasnew = $article->updateIfNewerOn( $dbw, $revision, $previousRevId ); + if ( $newid || $wasnew ) { + // Update site stats, link tables, etc + $article->createUpdates( $revision ); + } - if( $this->title->getNamespace() == NS_FILE ) { - $update = new HTMLCacheUpdate( $this->title, 'imagelinks' ); - $update->doUpdate(); - } + if( $newid ) { + wfRunHooks( 'ArticleUndelete', array( &$this->title, true, $comment ) ); + Article::onArticleCreate( $this->title ); } else { - // Revision couldn't be created. This is very weird - wfDebug( "Undelete: unknown error...\n" ); - return false; + wfRunHooks( 'ArticleUndelete', array( &$this->title, false, $comment ) ); + Article::onArticleEdit( $this->title ); + } + + if( $this->title->getNamespace() == NS_FILE ) { + $update = new HTMLCacheUpdate( $this->title, 'imagelinks' ); + $update->doUpdate(); } return $restored;