r100412 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100411‎ | r100412 | r100413 >
Date:05:24, 21 October 2011
Author:santhosh
Status:ok
Tags:
Comment:
Use $wgRequest->getCookie instead of $_COOKIE.
Modified paths:
  • /trunk/extensions/Narayam/Narayam.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Narayam/Narayam.hooks.php
@@ -56,7 +56,7 @@
5757 * @return array( scheme name => module name )
5858 */
5959 protected static function getSchemes() {
60 - global $wgLanguageCode, $wgLang, $wgNarayamSchemes;
 60+ global $wgLanguageCode, $wgLang, $wgNarayamSchemes, $wgRequest;
6161
6262 $userlangCode = $wgLang->getCode();
6363 $contlangSchemes = isset( $wgNarayamSchemes[$wgLanguageCode] ) ?
@@ -67,10 +67,7 @@
6868 $schemes = $userlangSchemes + $contlangSchemes;
6969
7070 // Get user selected scheme from cookie
71 - // TODO: use $wgRequest;
72 - $lastScheme = isset($_COOKIE['narayam-scheme'])
73 - ? $_COOKIE['narayam-scheme']
74 - : null;
 71+ $lastScheme = $wgRequest->getCookie( 'narayam-scheme', '', null );
7572 // If user selected scheme is not in the array of schemes to be loaded
7673 // Add it
7774 if ( $lastScheme && !array_key_exists( $lastScheme, $schemes ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r102305MFT r99387 r99395 r99456 r99457 r99682 r99683 r100013 r100024 r100108 r100212...nikerabbit18:21, 7 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100350Narayam: Remember dynamically loaded scheme next time utilizing cookie entry....junaidpv15:41, 20 October 2011
r100361Narayam: Fix undefined index issue in r100350.junaidpv19:01, 20 October 2011

Status & tagging log