Robmoen has submitted this change and it was merged.
Change subject: Delete the post-edit cookie using the correct domain
......................................................................
Delete the post-edit cookie using the correct domain
Use the mediawiki.cookie#set to delete the post-edit cookie so that the
correct domain is used.
Bug: 61979
Change-Id: I0cba8d1421f359ff78f3f994af358e9997f27041
---
M includes/EditPage.php
M resources/Resources.php
M resources/src/mediawiki.action/mediawiki.action.view.postEdit.js
3 files changed, 5 insertions(+), 8 deletions(-)
Approvals:
Robmoen: Looks good to me, approved
diff --git a/includes/EditPage.php b/includes/EditPage.php
index dac2d55..7be6274 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -1209,8 +1209,6 @@
* marked HttpOnly. The JavaScript code converts the cookie to a
wgPostEdit config
* variable.
*
- * We use a path of '/' since wgCookiePath is not exposed to JS
- *
* 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.
*
@@ -1229,7 +1227,6 @@
$response = RequestContext::getMain()->getRequest()->response();
$response->setcookie( $postEditKey, $val, time() +
self::POST_EDIT_COOKIE_DURATION, array(
- 'path' => '/',
'httpOnly' => false,
) );
}
diff --git a/resources/Resources.php b/resources/Resources.php
index 63e0ccd..a58cfdc 100644
--- a/resources/Resources.php
+++ b/resources/Resources.php
@@ -994,7 +994,7 @@
'scripts' =>
'resources/src/mediawiki.action/mediawiki.action.view.postEdit.js',
'styles' =>
'resources/src/mediawiki.action/mediawiki.action.view.postEdit.css',
'dependencies' => array(
- 'jquery.cookie',
+ 'mediawiki.cookie',
'mediawiki.jqueryMsg'
),
'messages' => array(
diff --git a/resources/src/mediawiki.action/mediawiki.action.view.postEdit.js
b/resources/src/mediawiki.action/mediawiki.action.view.postEdit.js
index 3419b5a..4d2c47a 100644
--- a/resources/src/mediawiki.action/mediawiki.action.view.postEdit.js
+++ b/resources/src/mediawiki.action/mediawiki.action.view.postEdit.js
@@ -18,10 +18,10 @@
* @member mw.hook
*/
- var config = mw.config.get( [ 'wgAction', 'wgCookiePrefix',
'wgCurRevisionId' ] ),
+ var config = mw.config.get( [ 'wgAction', 'wgCurRevisionId' ] ),
// This should match EditPage::POST_EDIT_COOKIE_KEY_PREFIX:
- cookieKey = config.wgCookiePrefix + 'PostEditRevision' +
config.wgCurRevisionId,
- cookieVal = $.cookie( cookieKey ),
+ cookieKey = 'PostEditRevision' + config.wgCurRevisionId,
+ cookieVal = mw.cookie.get( cookieKey ),
$div, id;
function showConfirmation( data ) {
@@ -80,7 +80,7 @@
mw.user
)
} );
- $.cookie( cookieKey, null, { path: '/' } );
+ mw.cookie.set( cookieKey, null );
}
} ( mediaWiki, jQuery ) );
--
To view, visit https://gerrit.wikimedia.org/r/122423
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0cba8d1421f359ff78f3f994af358e9997f27041
Gerrit-PatchSet: 13
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Phuedx <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: Robmoen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits