Index: trunk/phase3/includes/filerepo/LocalRepo.php |
— | — | @@ -83,9 +83,9 @@ |
84 | 84 | $title = Title::makeTitle( NS_FILE, $title->getText() ); |
85 | 85 | } |
86 | 86 | |
87 | | - $memcKey = $this->getSharedCacheKey( 'image_redirect', md5( $title->getPrefixedDBkey() ) ); |
| 87 | + $memcKey = $this->getSharedCacheKey( 'image_redirect', md5( $title->getDBkey() ) ); |
88 | 88 | if ( $memcKey === false ) { |
89 | | - $memcKey = $this->getLocalCacheKey( 'image_redirect', md5( $title->getPrefixedDBkey() ) ); |
| 89 | + $memcKey = $this->getLocalCacheKey( 'image_redirect', md5( $title->getDBkey() ) ); |
90 | 90 | $expiry = 300; // no invalidation, 5 minutes |
91 | 91 | } else { |
92 | 92 | $expiry = 86400; // has invalidation, 1 day |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | // Does not exist |
97 | 97 | return false; |
98 | 98 | } elseif ( strval( $cachedValue ) !== '' ) { |
99 | | - return Title::newFromText( $cachedValue ); |
| 99 | + return Title::newFromText( $cachedValue, NS_FILE ); |
100 | 100 | } // else $cachedValue is false or null: cache miss |
101 | 101 | |
102 | 102 | $id = $this->getArticleID( $title ); |
— | — | @@ -111,9 +111,9 @@ |
112 | 112 | __METHOD__ |
113 | 113 | ); |
114 | 114 | |
115 | | - if( $row ) { |
| 115 | + if( $row && $row->rd_namespace == NS_FILE ) { |
116 | 116 | $targetTitle = Title::makeTitle( $row->rd_namespace, $row->rd_title ); |
117 | | - $wgMemc->set( $memcKey, $targetTitle->getPrefixedDBkey(), $expiry ); |
| 117 | + $wgMemc->set( $memcKey, $targetTitle->getDBkey(), $expiry ); |
118 | 118 | return $targetTitle; |
119 | 119 | } else { |
120 | 120 | $wgMemc->set( $memcKey, '', $expiry ); |
— | — | @@ -193,7 +193,7 @@ |
194 | 194 | */ |
195 | 195 | function invalidateImageRedirect( $title ) { |
196 | 196 | global $wgMemc; |
197 | | - $memcKey = $this->getSharedCacheKey( 'image_redirect', md5( $title->getPrefixedDBkey() ) ); |
| 197 | + $memcKey = $this->getSharedCacheKey( 'image_redirect', md5( $title->getDBkey() ) ); |
198 | 198 | if ( $memcKey ) { |
199 | 199 | $wgMemc->delete( $memcKey ); |
200 | 200 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -545,6 +545,7 @@ |
546 | 546 | searching for special pages |
547 | 547 | * (bug 20524) Hideuser: Show nice error when trying to block hidden user without |
548 | 548 | hideuser right |
| 549 | +* (bug 21026) Fixed file redirects on shared repos on non-English client wikis |
549 | 550 | |
550 | 551 | == API changes in 1.16 == |
551 | 552 | |