(bug 44131) Change InfoAction cache key to use SHA1.
authorTyler Anthony Romeo <tylerromeo@gmail.com>
Mon, 21 Jan 2013 19:32:11 +0000 (14:32 -0500)
committerTyler Anthony Romeo <tylerromeo@gmail.com>
Mon, 21 Jan 2013 19:32:11 +0000 (14:32 -0500)
Long title names caused errors in caching of InfoAction
results, so this commit wraps the title in a SHA1 call
so that all titles will have valid cache keys.

Change-Id: I803a7dd58f5bd69070291192d3eead065d0403f1

includes/actions/InfoAction.php

index dedc61f..956104c 100644 (file)
@@ -172,7 +172,7 @@ class InfoAction extends FormlessAction {
                $title = $this->getTitle();
                $id = $title->getArticleID();
 
-               $memcKey = wfMemcKey( 'infoaction', $title->getPrefixedText(), $this->page->getLatest() );
+               $memcKey = wfMemcKey( 'infoaction', sha1( $title->getPrefixedText() ), $this->page->getLatest() );
                $pageCounts = $wgMemc->get( $memcKey );
                if ( $pageCounts === false ) {
                        // Get page information that would be too "expensive" to retrieve by normal means