* (bug 4385) Separate parser cache entries for non-editing users, so section
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 28 Dec 2005 22:28:04 +0000 (22:28 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 28 Dec 2005 22:28:04 +0000 (22:28 +0000)
  edit links don't vanish / appear unwanted on protected pages

RELEASE-NOTES
includes/ParserCache.php

index bed0f9d..3e4ae5a 100644 (file)
@@ -365,6 +365,8 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 4392) Update of LanguageSr.php
 * (bug 4382) Frisian numeric format
 * (bug 4411) Fix messages diff link for classic skin
+* (bug 4385) Separate parser cache entries for non-editing users, so section
+  edit links don't vanish / appear unwanted on protected pages
 
 
 === Caveats ===
index b6f5345..53f7212 100644 (file)
@@ -23,9 +23,15 @@ class ParserCache {
        function getKey( &$article, &$user ) {
                global $wgDBname, $action;
                $hash = $user->getPageRenderingHash();
+               if( !$article->mTitle->userCanEdit() ) {
+                       // section edit links are suppressed even if the user has them on
+                       $edit = '!edit=0';
+               } else {
+                       $edit = '';
+               }
                $pageid = intval( $article->getID() );
                $renderkey = (int)($action == 'render');
-               $key = "$wgDBname:pcache:idhash:$pageid-$renderkey!$hash";
+               $key = "$wgDBname:pcache:idhash:$pageid-$renderkey!$hash$edit";
                return $key;
        }