r96693 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96692‎ | r96693 | r96694 >
Date:21:08, 9 September 2011
Author:brion
Status:ok
Tags:
Comment:
* (bug 30834) Fix for incorrect cache handling of output language in CategoryTree ajax requests

Memcache key was not taking UI output language into account, and thus could serve you a cached record in another language from what should have been rendered for you.
Added UI language into the cache key, so they no longer interfere with each other.
Modified paths:
  • /trunk/extensions/CategoryTree/CategoryTreeFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CategoryTree/CategoryTreeFunctions.php
@@ -298,7 +298,7 @@
299299 * load CategoryTreeFunctions.php on demand.
300300 */
301301 function ajax( $category, $depth = 1 ) {
302 - global $wgContLang, $wgRenderHashAppend;
 302+ global $wgLang, $wgContLang, $wgRenderHashAppend;
303303 $title = self::makeTitle( $category );
304304
305305 if ( ! $title ) {
@@ -314,7 +314,7 @@
315315 'page_title' => $dbkey,
316316 ), __METHOD__ );
317317
318 - $mckey = wfMemcKey( "categorytree(" . $this->getOptionsAsCacheKey( $depth ) . ")", $dbkey, $wgContLang->getExtraHashOptions(), $wgRenderHashAppend );
 318+ $mckey = wfMemcKey( "categorytree(" . $this->getOptionsAsCacheKey( $depth ) . ")", $dbkey, $wgLang->getCode(), $wgContLang->getExtraHashOptions(), $wgRenderHashAppend );
319319
320320 $response = new AjaxResponse();
321321

Follow-up revisions

RevisionCommit summaryAuthorDate
r96694MFT r96693: memcache key fix for UI language in CategoryTree ajax requestsbrion21:12, 9 September 2011
r96695MFT r96693: memcache key fix for UI language in CategoryTree ajax requestsbrion21:12, 9 September 2011
r96696MFT r96693: memcache key fix for UI language in CategoryTree ajax requestsbrion21:12, 9 September 2011

Status & tagging log