r12275 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12274‎ | r12275 | r12276 >
Date:22:28, 28 December 2005
Author:vibber
Status:old
Tags:
Comment:
* (bug 4385) Separate parser cache entries for non-editing users, so section
edit links don't vanish / appear unwanted on protected pages
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/ParserCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ParserCache.php
@@ -23,9 +23,15 @@
2424 function getKey( &$article, &$user ) {
2525 global $wgDBname, $action;
2626 $hash = $user->getPageRenderingHash();
 27+ if( !$article->mTitle->userCanEdit() ) {
 28+ // section edit links are suppressed even if the user has them on
 29+ $edit = '!edit=0';
 30+ } else {
 31+ $edit = '';
 32+ }
2733 $pageid = intval( $article->getID() );
2834 $renderkey = (int)($action == 'render');
29 - $key = "$wgDBname:pcache:idhash:$pageid-$renderkey!$hash";
 35+ $key = "$wgDBname:pcache:idhash:$pageid-$renderkey!$hash$edit";
3036 return $key;
3137 }
3238
Index: trunk/phase3/RELEASE-NOTES
@@ -365,6 +365,8 @@
366366 * (bug 4392) Update of LanguageSr.php
367367 * (bug 4382) Frisian numeric format
368368 * (bug 4411) Fix messages diff link for classic skin
 369+* (bug 4385) Separate parser cache entries for non-editing users, so section
 370+ edit links don't vanish / appear unwanted on protected pages
369371
370372
371373 === Caveats ===

Status & tagging log