Skip to content
Snippets Groups Projects
Commit 8d67c48a authored by Adrian Lang's avatar Adrian Lang
Browse files

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.
parent 5a932e77
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment