X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FEditPage.php;h=dac2d55a75d04071b5d7e53b5f832c7c411f927a;hb=b41f33189a082d2b04ecd60361e3d89fdcd77f72;hp=c2803b69cf90af1a91468dc21bfe312314f46286;hpb=bc4147866e27965ca67bf88aac21c4ccfb061776;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index c2803b69cf..dac2d55a75 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1213,13 +1213,22 @@ class EditPage { * * If the variable were set on the server, it would be cached, which is unwanted * since the post-edit state should only apply to the load right after the save. + * + * @param $statusValue int The status value (to check for new article status) */ - protected function setPostEditCookie() { + protected function setPostEditCookie( $statusValue ) { $revisionId = $this->mArticle->getLatest(); $postEditKey = self::POST_EDIT_COOKIE_KEY_PREFIX . $revisionId; + $val = 'saved'; + if ( $statusValue == self::AS_SUCCESS_NEW_ARTICLE ) { + $val = 'created'; + } elseif ( $this->oldid ) { + $val = 'restored'; + } + $response = RequestContext::getMain()->getRequest()->response(); - $response->setcookie( $postEditKey, '1', time() + self::POST_EDIT_COOKIE_DURATION, array( + $response->setcookie( $postEditKey, $val, time() + self::POST_EDIT_COOKIE_DURATION, array( 'path' => '/', 'httpOnly' => false, ) ); @@ -1257,7 +1266,7 @@ class EditPage { if ( $status->value == self::AS_SUCCESS_UPDATE || $status->value == self::AS_SUCCESS_NEW_ARTICLE ) { $this->didSave = true; if ( !$resultDetails['nullEdit'] ) { - $this->setPostEditCookie(); + $this->setPostEditCookie( $status->value ); } }