Merge "Reduced the DOS potential of 404 page floods"
[lhc/web/wiklou.git] / includes / page / WikiPage.php
index 69b675b..9504bc1 100644 (file)
@@ -1765,7 +1765,6 @@ class WikiPage implements Page, IDBAccessObject {
 
                $dbw = wfGetDB( DB_MASTER );
                $now = wfTimestampNow();
-               $this->mTimestamp = $now;
 
                if ( $flags & EDIT_UPDATE ) {
                        // Update article, but only if changed.
@@ -1844,6 +1843,7 @@ class WikiPage implements Page, IDBAccessObject {
                                $user->incEditCount();
 
                                $dbw->commit( __METHOD__ );
+                               $this->mTimestamp = $now;
                        } else {
                                // Bug 32948: revision ID must be set to page {{REVISIONID}} and
                                // related variables correctly
@@ -1938,6 +1938,7 @@ class WikiPage implements Page, IDBAccessObject {
                        $user->incEditCount();
 
                        $dbw->commit( __METHOD__ );
+                       $this->mTimestamp = $now;
 
                        // Update links, etc.
                        $this->doEditUpdates( $revision, $user, array( 'created' => true ) );
@@ -2872,6 +2873,10 @@ class WikiPage implements Page, IDBAccessObject {
                        $dbw->commit( __METHOD__ );
                }
 
+               // Show log excerpt on 404 pages rather than just a link
+               $key = wfMemcKey( 'page-recent-delete', md5( $logTitle->getPrefixedText() ) );
+               ObjectCache::getMainStashInstance()->set( $key, 1, 86400 );
+
                $this->doDeleteUpdates( $id, $content );
 
                Hooks::run( 'ArticleDeleteComplete', array( &$this, &$user, $reason, $id, $content, $logEntry ) );