Bugfix: Set the history revision number 0 if no previous revisions exist

(Thanks again, @tspivey!)
This commit is contained in:
Starbeamrainbowlabs 2018-10-31 16:36:37 +00:00
parent 7e77412099
commit 3a2d74227d
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 2 additions and 2 deletions

View File

@ -233,8 +233,8 @@ function history_add_revision(&$pageinfo, &$newsource, &$oldsource, $save_pagein
// this point
// TODO Store tag changes here
end($pageinfo->history); // Calculate the next revision id - we can't jsut count the reivisions here because we might have a revision limit
$nextRid = $pageinfo->history[key($pageinfo->history)]->rid + 1;
end($pageinfo->history); // Calculate the next revision id - we can't just count the reivisions here because we might have a revision limit
$nextRid = !empty($pageindex->history) ? $pageinfo->history[key($pageinfo->history)]->rid + 1 : 0;
$ridFilename = "$pageinfo->filename.r$nextRid";
// Insert a new entry into the history
$pageinfo->history[] = [