r88662 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88661‎ | r88662 | r88663 >
Date:18:30, 23 May 2011
Author:catrope
Status:ok
Tags:
Comment:
ClickTracking: Use FormatJson instead of json_{encode,decode}
Modified paths:
  • /trunk/extensions/ClickTracking/ClickTracking.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ClickTracking/ClickTracking.hooks.php
@@ -145,7 +145,7 @@
146146 global $wgRequest;
147147
148148 //JSON-encoded because it's simple, can be replaced with any other encoding scheme
149 - return json_decode($wgRequest->getCookie('userbuckets',""), true);
 149+ return FormatJson::decode( $wgRequest->getCookie( 'userbuckets', "" ), true );
150150 }
151151
152152 /**
@@ -156,7 +156,7 @@
157157 public static function packBucketInfo( $buckets ){
158158 global $wgRequest;
159159 //Can be another encoding scheme, just needs to match unpackBucketInfo
160 - $packedBuckets = json_encode( $buckets );
 160+ $packedBuckets = FormatJson::encode( $buckets );
161161
162162 //NOTE: $wgRequest->response setCookie sets it with a prefix and httponly by default
163163 setcookie( 'userbuckets' , $packedBuckets ,

Status & tagging log