r111091 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111090‎ | r111091 | r111092 >
Date:21:06, 9 February 2012
Author:mrbluesky
Status:resolved (Comments)
Tags:
Comment:
(bug 17416) Don't prompt for summary when summary is preset using &summary=
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -182,6 +182,12 @@
183183 * @var ParserOutput
184184 */
185185 var $mParserOutput;
 186+
 187+ /**
 188+ * Has a summary been preset using GET parameter &summary= ?
 189+ * @var Bool
 190+ */
 191+ var $hasPresetSummary = false;
186192
187193 var $mBaseRevision = false;
188194 var $mShowSummaryField = true;
@@ -679,6 +685,9 @@
680686 }
681687 elseif ( $this->section != 'new' && $request->getVal( 'summary' ) ) {
682688 $this->summary = $request->getText( 'summary' );
 689+ if ( $this->summary !== '' ) {
 690+ $this->hasPresetSummary = true;
 691+ }
683692 }
684693
685694 if ( $request->getVal( 'minor' ) ) {
@@ -1795,6 +1804,13 @@
17961805 $wgOut->addHTML( Html::hidden( 'wpIgnoreBlankSummary', true ) );
17971806 }
17981807
 1808+ if ( $this->hasPresetSummary ) {
 1809+ // If a summary has been preset using &summary= we dont want to prompt for
 1810+ // a different summary. Only prompt for a summary if the summary is blanked.
 1811+ // (Bug 17416)
 1812+ $this->autoSumm = 'd41d8cd98f00b204e9800998ecf8427e'; # == md5('')
 1813+ }
 1814+
17991815 $autosumm = $this->autoSumm ? $this->autoSumm : md5( $this->summary );
18001816 $wgOut->addHTML( Html::hidden( 'wpAutoSummary', $autosumm ) );
18011817

Follow-up revisions

RevisionCommit summaryAuthorDate
r111223Follow-up to r111091. Dont paste md5 in the code.mrbluesky01:11, 11 February 2012

Comments

#Comment by Aaron Schulz (talk | contribs)   00:07, 11 February 2012

Please just use md5() instead of pasting the result in the code.

#Comment by MrBlueSky (talk | contribs)   01:12, 11 February 2012

Fixed: r111223.

Status & tagging log