r101103 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101102‎ | r101103 | r101104 >
Date:00:55, 28 October 2011
Author:preilly
Status:resolved (Comments)
Tags:
Comment:
fix cookie prefix
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -620,12 +620,15 @@
621621 * @param $value string
622622 */
623623 private function setOptInOutCookie( $value ) {
624 - global $wgCookieDomain, $wgRequest;
 624+ global $wgCookieDomain, $wgRequest, $wgCookiePrefix;
625625 wfProfileIn( __METHOD__ );
626626 $tempWgCookieDomain = $wgCookieDomain;
627627 $wgCookieDomain = $this->getBaseDomain();
 628+ $tempWgCookiePrefix = $wgCookiePrefix;
 629+ $wgCookiePrefix = '';
628630 $wgRequest->response()->setcookie( 'optin', $value, 0, '' );
629631 $wgCookieDomain = $tempWgCookieDomain;
 632+ $wgCookiePrefix = $tempWgCookiePrefix;
630633 wfProfileOut( __METHOD__ );
631634 }
632635

Follow-up revisions

RevisionCommit summaryAuthorDate
r101104mft r101103preilly00:55, 28 October 2011

Comments

#Comment by 😂 (talk | contribs)   01:03, 28 October 2011

Rather than overriding $wgCookiePrefix, how about you use the optional $prefix parameter for it I added in r94211. Went ahead and merged it in r101106, r101107

#Comment by Preilly (talk | contribs)   01:10, 28 October 2011

It wasn't in production yet — so, I needed to do it the other way. Once that is in production I'll totally use it.

#Comment by 😂 (talk | contribs)   01:33, 28 October 2011

You could've asked...

Status & tagging log