From 3d1f9ec3674462e63f4195dd834603148a7c7b42 Mon Sep 17 00:00:00 2001 From: Michael Klier Date: Wed, 26 Mar 2008 21:02:31 +0100 Subject: purge non-persistent meta data on page deletion With this patch applied the persistent meta data of pages is kept when a page is deleted. This way the original page creator as well as the creation time of the page is preserved. darcs-hash:20080326200231-23886-ddb70151fadf25d0254d56408b71484047198096.gz --- inc/common.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index f86d8e2fb..885fb85d4 100644 --- a/inc/common.php +++ b/inc/common.php @@ -842,10 +842,13 @@ function saveWikiText($id,$text,$summary,$minor=false){ // remove old meta info... $mfiles = metaFiles($id); $changelog = metaFN($id, '.changes'); + $metadata = metaFN($id, '.meta'); foreach ($mfiles as $mfile) { - // but keep per-page changelog to preserve page history - if (@file_exists($mfile) && $mfile!==$changelog) { @unlink($mfile); } + // but keep per-page changelog to preserve page history and keep meta data + if (@file_exists($mfile) && $mfile!==$changelog && $mfile!==$metadata) { @unlink($mfile); } } + // purge meta data + p_purge_metadata($id); $del = true; // autoset summary on deletion if(empty($summary)) $summary = $lang['deleted']; -- cgit v1.2.3