diff options
author | Michael Klier <chi@chimeric.de> | 2008-03-26 21:02:31 +0100 |
---|---|---|
committer | Michael Klier <chi@chimeric.de> | 2008-03-26 21:02:31 +0100 |
commit | 3d1f9ec3674462e63f4195dd834603148a7c7b42 (patch) | |
tree | e0a310e687ce3595adb45658c15b472fd99ab8fb /inc/common.php | |
parent | 6a5b38cd97b00e27beaae7e3158f868dfcde4193 (diff) | |
download | rpg-3d1f9ec3674462e63f4195dd834603148a7c7b42.tar.gz rpg-3d1f9ec3674462e63f4195dd834603148a7c7b42.tar.bz2 |
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
Diffstat (limited to 'inc/common.php')
-rw-r--r-- | inc/common.php | 7 |
1 files changed, 5 insertions, 2 deletions
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']; |