Santhosh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/183778
Change subject: Fix the wrong domain name for translation token if domain is
localhost
......................................................................
Fix the wrong domain name for translation token if domain is localhost
Bug: T86292
Change-Id: I7c253b74f35b83dee32bec900cf67afcb0b3e82e
---
M modules/source/ext.cx.source.selector.js
1 file changed, 5 insertions(+), 3 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation
refs/changes/78/183778/1
diff --git a/modules/source/ext.cx.source.selector.js
b/modules/source/ext.cx.source.selector.js
index 9e24c7a..63d11f6 100644
--- a/modules/source/ext.cx.source.selector.js
+++ b/modules/source/ext.cx.source.selector.js
@@ -762,16 +762,18 @@
* @param {string} sourceTitle Source title
*/
function setCXToken( sourceLanguage, targetLanguage, sourceTitle ) {
- var slug, now, name, options;
+ var slug, now, name, options, domain;
now = new Date();
slug = sourceTitle.replace( /\s/g, '-' );
name = [ 'cx', slug, sourceLanguage, targetLanguage ].join( '_'
);
-
+ domain = location.hostname.indexOf( '.' ) > 0 ?
+ '.' + location.hostname.split( '.' ).splice( 1 ).join(
'.' ) :
+ location.hostname; // Mostly domains like "localhost"
options = {
prefix: '',
// Use Domain cookie. Example: domain=.wikipedia.org
- domain: '.' + location.hostname.split( '.' ).splice( 1
).join( '.' ),
+ domain: domain,
expires: new Date( now.getTime() + ( 5 * 60 * 1000 ) )
// 5 mins from now.
};
--
To view, visit https://gerrit.wikimedia.org/r/183778
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c253b74f35b83dee32bec900cf67afcb0b3e82e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits