From 6bec913ef6e67fde3924928b10e8c42a9c0a3f3c Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Mon, 13 Nov 2006 11:08:09 +0000 Subject: [PATCH] Bloody hell, not another pretend feature --- includes/Article.php | 14 ++++++++++++++ languages/messages/MessagesEn.php | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/includes/Article.php b/includes/Article.php index cc2a5d93fc..26129eb526 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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(), diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 1eb8b7e4de..d6fbc7dcd8 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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. ); ?> -- 2.20.1