Index: trunk/phase3/includes/SpecialUndelete.php |
— | — | @@ -158,7 +158,14 @@ |
159 | 159 | |
160 | 160 | $u = new LinksUpdate( $newid, $to->getPrefixedDBkey() ); |
161 | 161 | array_push( $wgDeferredUpdateList, $u ); |
162 | | - |
| 162 | + |
| 163 | + global $wgEnablePersistentLC; |
| 164 | + if ( $wgEnablePersistentLC ) { |
| 165 | + // Purge related entries in links cache on undelete, to heal broken links |
| 166 | + $ptitle = wfStrencode( $to->getPrefixedDBkey() ); |
| 167 | + wfQuery("DELETE linkscc FROM linkscc,brokenlinks ". |
| 168 | + "WHERE lcc_pageid=bl_from AND bl_to='{$ptitle}'", DB_WRITE); |
| 169 | + } |
163 | 170 | #TODO: SearchUpdate, etc. |
164 | 171 | } |
165 | 172 | |