Reduced the DOS potential of 404 page floods
[lhc/web/wiklou.git] / includes / page / WikiPage.php
index 657c4d0..7557b04 100644 (file)
@@ -2854,7 +2854,7 @@ class WikiPage implements Page, IDBAccessObject {
                // Clone the title, so we have the information we need when we log
                $logTitle = clone $this->mTitle;
 
-               // Log the deletion, if the page was suppressed, log it at Oversight instead
+               // Log the deletion, if the page was suppressed, put it in the suppression log instead
                $logtype = $suppress ? 'suppress' : 'delete';
 
                $logEntry = new ManualLogEntry( $logtype, 'delete' );
@@ -2872,6 +2872,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 ) );