From: Aaron Schulz Date: Thu, 6 Jun 2013 20:40:07 +0000 (-0700) Subject: Fixed long memcached keys for infoaction. X-Git-Tag: 1.31.0-rc.0~19479^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=66500c1f443fb9095048fbe149e30ba00e7cc207;p=lhc%2Fweb%2Fwiklou.git Fixed long memcached keys for infoaction. * One place was already using SHA1, so invalidation was broken. Change-Id: Ie0d3b9274ed2e1c5a7b1616cd237a5e25fd99d12 --- diff --git a/includes/actions/InfoAction.php b/includes/actions/InfoAction.php index 7cd1f72ee6..e3ea6fcc4a 100644 --- a/includes/actions/InfoAction.php +++ b/includes/actions/InfoAction.php @@ -66,8 +66,8 @@ class InfoAction extends FormlessAction { // Clear page info. $revision = WikiPage::factory( $title )->getRevision(); if ( $revision !== null ) { - $memcKey = wfMemcKey( 'infoaction', $title->getPrefixedText(), $revision->getId() ); - $wgMemc->delete( $memcKey ); + $key = wfMemcKey( 'infoaction', sha1( $title->getPrefixedText() ), $revision->getId() ); + $wgMemc->delete( $key ); } } @@ -185,14 +185,16 @@ class InfoAction extends FormlessAction { * @return array */ protected function pageInfo() { - global $wgContLang, $wgRCMaxAge, $wgMemc, $wgUnwatchedPageThreshold, $wgPageInfoTransclusionLimit; + global $wgContLang, $wgRCMaxAge, $wgMemc, + $wgUnwatchedPageThreshold, $wgPageInfoTransclusionLimit; $user = $this->getUser(); $lang = $this->getLanguage(); $title = $this->getTitle(); $id = $title->getArticleID(); - $memcKey = wfMemcKey( 'infoaction', sha1( $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