From: Tim Starling Date: Wed, 8 Nov 2006 08:06:51 +0000 (+0000) Subject: Fixed pollution of a backend function with UI-only features. Autosummaries off by... X-Git-Tag: 1.31.0-rc.0~55255 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmembres/cotisations/gestion/rappel_supprimer.php?a=commitdiff_plain;h=f22cd6bd5db066797d6b7e36e8feb22147e71442;p=lhc%2Fweb%2Fwiklou.git Fixed pollution of a backend function with UI-only features. Autosummaries off by default. --- diff --git a/includes/Article.php b/includes/Article.php index b2c3b7efd5..73f0585b68 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1154,7 +1154,7 @@ class Article { * @deprecated use Article::doEdit() */ function insertNewArticle( $text, $summary, $isminor, $watchthis, $suppressRC=false, $comment=false ) { - $flags = EDIT_NEW | EDIT_DEFER_UPDATES | + $flags = EDIT_NEW | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY | ( $isminor ? EDIT_MINOR : 0 ) | ( $suppressRC ? EDIT_SUPPRESS_RC : 0 ); @@ -1186,7 +1186,7 @@ class Article { * @deprecated use Article::doEdit() */ function updateArticle( $text, $summary, $minor, $watchthis, $forceBot = false, $sectionanchor = '' ) { - $flags = EDIT_UPDATE | EDIT_DEFER_UPDATES | + $flags = EDIT_UPDATE | EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY | ( $minor ? EDIT_MINOR : 0 ) | ( $forceBot ? EDIT_FORCE_BOT : 0 ); @@ -1235,6 +1235,8 @@ class Article { * Mark the edit a "bot" edit regardless of user rights * EDIT_DEFER_UPDATES * Defer some of the updates until the end of index.php + * EDIT_AUTOSUMMARY + * Fill in blank summaries with generated text where possible * * If neither EDIT_NEW nor EDIT_UPDATE is specified, the status of the article will be detected. * If EDIT_UPDATE is specified and the article doesn't exist, the function will return false. If @@ -1274,7 +1276,7 @@ class Article { # If no edit comment was given when creating a new page, and what's being # created is a redirect, be smart and fill in a neat auto-comment - if( $summary == '' ) { + if ( $flags & EDIT_AUTOSUMMARY && $summary == '' ) { $rt = Title::newFromRedirect( $text ); if( is_object( $rt ) ) $summary = wfMsgForContent( 'autoredircomment', $rt->getPrefixedText() ); diff --git a/includes/Defines.php b/includes/Defines.php index 407274857b..84bc44950f 100644 --- a/includes/Defines.php +++ b/includes/Defines.php @@ -193,6 +193,7 @@ define( 'EDIT_MINOR', 4 ); define( 'EDIT_SUPPRESS_RC', 8 ); define( 'EDIT_FORCE_BOT', 16 ); define( 'EDIT_DEFER_UPDATES', 32 ); +define( 'EDIT_AUTOSUMMARY', 64 ); /**#@-*/ /**