From af38b9bf09d14f1756f5d98c43f061c5ab76956d Mon Sep 17 00:00:00 2001 From: mrbluesky Date: Thu, 9 Feb 2012 21:06:19 +0000 Subject: [PATCH] (bug 17416) Don't prompt for summary when summary is preset using &summary= --- includes/EditPage.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/includes/EditPage.php b/includes/EditPage.php index 466b8df9df..25ebc3c078 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -182,6 +182,12 @@ class EditPage { * @var ParserOutput */ var $mParserOutput; + + /** + * Has a summary been preset using GET parameter &summary= ? + * @var Bool + */ + var $hasPresetSummary = false; var $mBaseRevision = false; var $mShowSummaryField = true; @@ -679,6 +685,9 @@ class EditPage { } elseif ( $this->section != 'new' && $request->getVal( 'summary' ) ) { $this->summary = $request->getText( 'summary' ); + if ( $this->summary !== '' ) { + $this->hasPresetSummary = true; + } } if ( $request->getVal( 'minor' ) ) { @@ -1795,6 +1804,13 @@ class EditPage { $wgOut->addHTML( Html::hidden( 'wpIgnoreBlankSummary', true ) ); } + if ( $this->hasPresetSummary ) { + // If a summary has been preset using &summary= we dont want to prompt for + // a different summary. Only prompt for a summary if the summary is blanked. + // (Bug 17416) + $this->autoSumm = 'd41d8cd98f00b204e9800998ecf8427e'; # == md5('') + } + $autosumm = $this->autoSumm ? $this->autoSumm : md5( $this->summary ); $wgOut->addHTML( Html::hidden( 'wpAutoSummary', $autosumm ) ); -- 2.20.1