Make ParserCache::getKey backward-compatible, so it doesn't break FlaggedRevs
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Fri, 20 Mar 2009 16:53:22 +0000 (16:53 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Fri, 20 Mar 2009 16:53:22 +0000 (16:53 +0000)
includes/parser/ParserCache.php

index 22a3f7a..d17214c 100644 (file)
@@ -28,7 +28,10 @@ class ParserCache {
 
        function getKey( &$article, $popts ) {
                global $wgRequest;
-               
+
+               if( $popts instanceof User )    // It used to be getKey( &$article, &$user )
+                       $popts = ParserOptions::newFromUser( $popts );
+
                $user = $popts->mUser;
                $printable = ( $popts->getIsPrintable() ) ? '!printable=1' : '';
                $hash = $user->getPageRenderingHash();