From: Mr. E23 Date: Fri, 28 Nov 2003 08:03:49 +0000 (+0000) Subject: Purging relevant linkscc entries on page undelete. X-Git-Tag: 1.1.0~67 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=bbd29892d5552842d9e22b82f1f955c26cff0b0d;p=lhc%2Fweb%2Fwiklou.git Purging relevant linkscc entries on page undelete. --- diff --git a/includes/SpecialUndelete.php b/includes/SpecialUndelete.php index 6c8a24b254..3fda4d3017 100644 --- a/includes/SpecialUndelete.php +++ b/includes/SpecialUndelete.php @@ -158,7 +158,14 @@ function wfSpecialUndelete( $par ) $u = new LinksUpdate( $newid, $to->getPrefixedDBkey() ); array_push( $wgDeferredUpdateList, $u ); - + + global $wgEnablePersistentLC; + if ( $wgEnablePersistentLC ) { + // Purge related entries in links cache on undelete, to heal broken links + $ptitle = wfStrencode( $to->getPrefixedDBkey() ); + wfQuery("DELETE linkscc FROM linkscc,brokenlinks ". + "WHERE lcc_pageid=bl_from AND bl_to='{$ptitle}'", DB_WRITE); + } #TODO: SearchUpdate, etc. }