Bloody hell, not another pretend feature
authorAndrew Garrett <werdna@users.mediawiki.org>
Mon, 13 Nov 2006 11:08:09 +0000 (11:08 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Mon, 13 Nov 2006 11:08:09 +0000 (11:08 +0000)
includes/Article.php
languages/messages/MessagesEn.php

index cc2a5d9..26129eb 100644 (file)
@@ -1315,6 +1315,20 @@ class Article {
                                        wfProfileOut( __METHOD__ );
                                        return false;
                                }
+
+                               if (!$summary) {
+                                       #If they're blanking an article, note it in the summary.
+                                       if (/*$flags & EDIT_AUTOSUMMARY && */$oldtext!='' && $text=='') {
+                                               $summary = wfMsgForContent('autosumm-blank');
+                                       }
+       
+                                       #Blanking and replacing with something short
+                                       if (strlen($oldtext) / strlen($text) > 10 && strlen($text) < 500) { #Removing more than 90% of the article
+                                               global $wgContLang;
+                                               $truncatedtext = $wgContLang->truncate($text, 200 - strlen(wfMsg('autosumm-replace')), '...');
+                                               $summary = wfMsgForContent('autosumm-replace', $truncatedtext);
+                                       }
+                               }
                                
                                $revision = new Revision( array(
                                        'page'       => $this->getId(),
index 1eb8b7e..d6fbc7d 100644 (file)
@@ -632,7 +632,6 @@ parent class in order maintain consistency across languages.
 'viewtalkpage' => 'View discussion',
 'otherlanguages' => 'In other languages',
 'redirectedfrom' => '(Redirected from $1)',
-'autoredircomment' => 'Redirecting to [[$1]]',
 'redirectpagesub' => 'Redirect page',
 'lastmodifiedat'               => 'This page was last modified $2, $1.',       //$1 date, $2 time
 'viewcount'            => 'This page has been accessed {{plural:$1|one time|$1 times}}.',
@@ -2588,6 +2587,10 @@ Please confirm that really want to recreate this page.',
 'table_pager_limit_submit' => 'Go',
 'table_pager_empty' => 'No results',
 
+#Auto-summaries
+'autosumm-blank' => 'Blanking page',
+'autosumm-replace' => 'Replacing page with \'$1\'',
+'autoredircomment' => 'Redirecting to [[$1]]', #This should be changed to the new naming convention, but existed beforehand.
 );
 
 ?>