diff options
author | Adrian Lang <lang@cosmocode.de> | 2010-03-10 10:07:57 +0100 |
---|---|---|
committer | Adrian Lang <lang@cosmocode.de> | 2010-03-10 10:12:03 +0100 |
commit | 8d67c48ac883f874037848be833920f4a6426995 (patch) | |
tree | 76db80c775f27d4405d72b2ce7042baef28037ac /inc/actions.php | |
parent | 5a932e77b3c806514203323540cb30e5ab9c28cf (diff) | |
download | rpg-8d67c48ac883f874037848be833920f4a6426995.tar.gz rpg-8d67c48ac883f874037848be833920f4a6426995.tar.bz2 |
Correct edit conflict detection
Edit conflicts occur when a page has been edited since starting the current edit.
In order to detect them, the date of the newest revision is saved.
Diffstat (limited to 'inc/actions.php')
-rw-r--r-- | inc/actions.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/inc/actions.php b/inc/actions.php index 2be5259fd..01d1d29d4 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -312,14 +312,15 @@ function act_save($act){ global $SUF; global $SUM; global $lang; + global $INFO; //spam check if(checkwordblock()) { msg($lang['wordblock'], -1); return 'edit'; } - //conflict check //FIXME use INFO - if($DATE != 0 && @filemtime(wikiFN($ID)) > $DATE ) + //conflict check + if($DATE != 0 && $INFO['meta']['date']['modified'] > $DATE ) return 'conflict'; //save it @@ -487,7 +488,9 @@ function act_edit($act){ } } - if(!$DATE) $DATE = $INFO['lastmod']; + // Use the date of the newest revision, not of the revision we edit + // This is used for conflict detection + if(!$DATE) $DATE = $INFO['meta']['date']['modified']; //check if locked by anyone - if not lock for my self $lockedby = checklock($ID); |