r57435 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57434‎ | r57435 | r57436 >
Date:20:26, 6 October 2009
Author:brion
Status:ok
Tags:
Comment:
Merge r57434 from trunk: fix for bug 21026 prob w/ shared repo redirects in multilingual environment
Modified paths:
  • /branches/wmf-deployment/includes/filerepo (modified) (history)
  • /branches/wmf-deployment/includes/filerepo/LocalRepo.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/includes/filerepo/LocalRepo.php
@@ -83,9 +83,9 @@
8484 $title = Title::makeTitle( NS_FILE, $title->getText() );
8585 }
8686
87 - $memcKey = $this->getSharedCacheKey( 'image_redirect', md5( $title->getPrefixedDBkey() ) );
 87+ $memcKey = $this->getSharedCacheKey( 'image_redirect', md5( $title->getDBkey() ) );
8888 if ( $memcKey === false ) {
89 - $memcKey = $this->getLocalCacheKey( 'image_redirect', md5( $title->getPrefixedDBkey() ) );
 89+ $memcKey = $this->getLocalCacheKey( 'image_redirect', md5( $title->getDBkey() ) );
9090 $expiry = 300; // no invalidation, 5 minutes
9191 } else {
9292 $expiry = 86400; // has invalidation, 1 day
@@ -95,7 +95,7 @@
9696 // Does not exist
9797 return false;
9898 } elseif ( strval( $cachedValue ) !== '' ) {
99 - return Title::newFromText( $cachedValue );
 99+ return Title::newFromText( $cachedValue, NS_FILE );
100100 } // else $cachedValue is false or null: cache miss
101101
102102 $id = $this->getArticleID( $title );
@@ -111,9 +111,9 @@
112112 __METHOD__
113113 );
114114
115 - if( $row ) {
 115+ if( $row && $row->rd_namespace == NS_FILE ) {
116116 $targetTitle = Title::makeTitle( $row->rd_namespace, $row->rd_title );
117 - $wgMemc->set( $memcKey, $targetTitle->getPrefixedDBkey(), $expiry );
 117+ $wgMemc->set( $memcKey, $targetTitle->getDBkey(), $expiry );
118118 return $targetTitle;
119119 } else {
120120 $wgMemc->set( $memcKey, '', $expiry );
@@ -193,7 +193,7 @@
194194 */
195195 function invalidateImageRedirect( $title ) {
196196 global $wgMemc;
197 - $memcKey = $this->getSharedCacheKey( 'image_redirect', md5( $title->getPrefixedDBkey() ) );
 197+ $memcKey = $this->getSharedCacheKey( 'image_redirect', md5( $title->getDBkey() ) );
198198 if ( $memcKey ) {
199199 $wgMemc->delete( $memcKey );
200200 }
Property changes on: branches/wmf-deployment/includes/filerepo
___________________________________________________________________
Name: svn:mergeinfo
201201 + /branches/REL1_15/phase3/includes/filerepo:51646
/branches/wmf-deployment/includes/filerepo:53381
/trunk/phase3/includes/filerepo:56213,56215-56216,56218,56334-56336,56338,56340,56343,56345,56347,56350,57388-57389,57434

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r57434* (bug 21026) Fixed file redirects on shared repos on non-English client wikis...brion20:23, 6 October 2009

Status & tagging log