1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 04:23:01 +00:00

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

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[] = [