r17485 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17484‎ | r17485 | r17486 >
Date:08:06, 8 November 2006
Author:tstarling
Status:old
Tags:
Comment:
Fixed pollution of a backend function with UI-only features. Autosummaries off by default.
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/Defines.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Defines.php
@@ -193,6 +193,7 @@
194194 define( 'EDIT_SUPPRESS_RC', 8 );
195195 define( 'EDIT_FORCE_BOT', 16 );
196196 define( 'EDIT_DEFER_UPDATES', 32 );
 197+define( 'EDIT_AUTOSUMMARY', 64 );
197198 /**#@-*/
198199
199200 /**
Index: trunk/phase3/includes/Article.php
@@ -1154,7 +1154,7 @@
11551155 * @deprecated use Article::doEdit()
11561156 */
11571157 function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) {
1158 - $flags = EDIT_NEW | EDIT_DEFER_UPDATES |
 1158+ $flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY |
11591159 ( $isminor ? EDIT_MINOR : 0 ) |
11601160 ( $suppressRC ? EDIT_SUPPRESS_RC : 0 );
11611161
@@ -1186,7 +1186,7 @@
11871187 * @deprecated use Article::doEdit()
11881188 */
11891189 function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor = '' ) {
1190 - $flags = EDIT_UPDATE | EDIT_DEFER_UPDATES |
 1190+ $flags = EDIT_UPDATE | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY |
11911191 ( $minor ? EDIT_MINOR : 0 ) |
11921192 ( $forceBot ? EDIT_FORCE_BOT : 0 );
11931193
@@ -1235,6 +1235,8 @@
12361236 * Mark the edit a "bot" edit regardless of user rights
12371237 * EDIT_DEFER_UPDATES
12381238 * Defer some of the updates until the end of index.php
 1239+ * EDIT_AUTOSUMMARY
 1240+ * Fill in blank summaries with generated text where possible
12391241 *
12401242 * If neither EDIT_NEW nor EDIT_UPDATE is specified, the status of the article will be detected.
12411243 * If EDIT_UPDATE is specified and the article doesn't exist, the function will return false. If
@@ -1274,7 +1276,7 @@
12751277
12761278 # If no edit comment was given when creating a new page, and what's being
12771279 # created is a redirect, be smart and fill in a neat auto-comment
1278 - if( $summary == '' ) {
 1280+ if ( $flags & EDIT_AUTOSUMMARY && $summary == '' ) {
12791281 $rt = Title::newFromRedirect( $text );
12801282 if( is_object( $rt ) )
12811283 $summary = wfMsgForContent( 'autoredircomment', $rt->getPrefixedText() );