Revert 40741. Causes "Division by zero in includes/LinksUpdate.php on line 210"
[lhc/web/wiklou.git] / includes / LinkCache.php
index d3cafac..4f74cdd 100644 (file)
@@ -89,8 +89,18 @@ class LinkCache {
                unset( $this->mBadLinks[$title] );
        }
 
-       /* obsolete, for old $wgLinkCacheMemcached stuff */
-       public function clearLink( $title ) {}
+       public function clearLink( $title ) {
+               $dbkey = $title->getPrefixedDbKey();
+               if( isset($this->mBadLinks[$dbkey]) ) {
+                       unset($this->mBadLinks[$dbkey]);
+               }
+               if( isset($this->mGoodLinks[$dbkey]) ) {
+                       unset($this->mGoodLinks[$dbkey]);
+               }
+               if( isset($this->mGoodLinkFields[$dbkey]) ) {
+                       unset($this->mGoodLinkFields[$dbkey]);
+               }
+       }
 
        public function getGoodLinks() { return $this->mGoodLinks; }
        public function getBadLinks() { return array_keys( $this->mBadLinks ); }