Gergő Tisza has uploaded a new change for review.
https://gerrit.wikimedia.org/r/303744
Change subject: Apply mobile cookie domain fix to beta
......................................................................
Apply mobile cookie domain fix to beta
Bug: T49647
Bug: T142015
Change-Id: I7a3c641382d9300e001a3c7e439baabc02f582fa
---
M wmf-config/mobile-labs.php
1 file changed, 17 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config
refs/changes/44/303744/1
diff --git a/wmf-config/mobile-labs.php b/wmf-config/mobile-labs.php
index 590df84..07e60b4 100644
--- a/wmf-config/mobile-labs.php
+++ b/wmf-config/mobile-labs.php
@@ -21,3 +21,20 @@
$wgMFSpecialCaseMainPage = $wmgMFSpecialCaseMainPage;
$wgMFMobileFormatterHeadings = $wmgMFMobileFormatterHeadings;
+
+// T49647
+$wgHooks['EnterMobileMode'][] = function() {
+ global $wgCentralAuthCookieDomain, $wgHooks;
+
+ if ( preg_match( '\.wikimedia\.org$', $wgCentralAuthCookieDomain ) ) {
+ $wgCentralAuthCookieDomain = preg_replace( '\.wikimedia\.org$',
'.m.wikimedia.org',
+ $wgCentralAuthCookieDomain );
+ }
+ $wgHooks['WebResponseSetCookie'][] = function ( &$name, &$value,
&$expire, &$options ) {
+ if ( isset( $options['domain'] ) && preg_match(
'\.wikimedia\.org$', $options['domain'] ) ) {
+ $options['domain'] = preg_replace( '\.wikimedia\.org$',
'.m.wikimedia.org',
+ $options['domain'] );
+ }
+ };
+};
+
--
To view, visit https://gerrit.wikimedia.org/r/303744
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a3c641382d9300e001a3c7e439baabc02f582fa
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits