http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88250

Revision: 88250
Author:   ialex
Date:     2011-05-16 17:41:58 +0000 (Mon, 16 May 2011)
Log Message:
-----------
Only increment the page count if the page has been created; also simplified a 
bit the code

Modified Paths:
--------------
    trunk/phase3/includes/specials/SpecialUndelete.php

Modified: trunk/phase3/includes/specials/SpecialUndelete.php
===================================================================
--- trunk/phase3/includes/specials/SpecialUndelete.php  2011-05-16 17:39:32 UTC 
(rev 88249)
+++ trunk/phase3/includes/specials/SpecialUndelete.php  2011-05-16 17:41:58 UTC 
(rev 88250)
@@ -526,18 +526,21 @@
                        return 0;
                }
 
+               $created = (bool)$newid;
+
                // Attach the latest revision to the page...
                $wasnew = $article->updateIfNewerOn( $dbw, $revision, 
$previousRevId );
-               if ( $newid || $wasnew ) {
+               if ( $created || $wasnew ) {
                        // Update site stats, link tables, etc
-                       $article->createUpdates( $revision );
+                       $article->editUpdates( $revision->getText(), 
$revision->getComment(),
+                               $revision->isMinor(), wfTimestamp(), 
$revision->getId(), true, null, $created );
                }
 
-               if( $newid ) {
-                       wfRunHooks( 'ArticleUndelete', array( &$this->title, 
true, $comment ) );
+               wfRunHooks( 'ArticleUndelete', array( &$this->title, $created, 
$comment ) );
+
+               if( $created ) {
                        Article::onArticleCreate( $this->title );
                } else {
-                       wfRunHooks( 'ArticleUndelete', array( &$this->title, 
false, $comment ) );
                        Article::onArticleEdit( $this->title );
                }
 


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to