From c67a95176be540153de67d44683373d9d8979db2 Mon Sep 17 00:00:00 2001 From: Matthew Flaschen Date: Wed, 6 Mar 2013 12:32:56 -0800 Subject: [PATCH] Don't set wgPostEdit for null edits. Bug: 45781 Change-Id: Ia2c3e02304fad07425af520850fe30ca5eab0c8e --- includes/EditPage.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 027fa01fdb..5dfb97bef7 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1189,7 +1189,9 @@ class EditPage { // FIXME: once the interface for internalAttemptSave() is made nicer, this should use the message in $status if ( $status->value == self::AS_SUCCESS_UPDATE || $status->value == self::AS_SUCCESS_NEW_ARTICLE ) { $this->didSave = true; - $this->setPostEditCookie(); + if ( !$resultDetails['nullEdit'] ) { + $this->setPostEditCookie(); + } } switch ( $status->value ) { @@ -1324,8 +1326,12 @@ class EditPage { /** * Attempt submission (no UI) * - * @param $result - * @param $bot bool + * @param array $result array to add statuses to, currently with the possible keys: + * spam - string - Spam string from content if any spam is detected by matchSpamRegex + * sectionanchor - string - Section anchor for a section save + * nullEdit - boolean - Set if doEditContent is OK. True if null edit, false otherwise. + * redirect - boolean - Set if doEditContent is OK. True if resulting revision is a redirect + * @param bool $bot True if edit is being made under the bot right. * * @return Status object, possibly with a message, but always with one of the AS_* constants in $status->value, * @@ -1718,6 +1724,7 @@ class EditPage { return $doEditStatus; } + $result['nullEdit'] = $doEditStatus->hasMessage( 'edit-no-change' ); $result['redirect'] = $content->isRedirect(); $this->updateWatchlist(); wfProfileOut( __METHOD__ ); -- 2.20.1