Merge pull request #3348 from ssahara/issue3339

set proper revinfo when media meta file is not available
This commit is contained in:
Andreas Gohr 2020-11-25 20:53:43 +01:00 committed by GitHub
commit c843d5563e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -193,6 +193,7 @@ class Revisions extends Ui
* @param int $first
* @param bool $hasNext
* @return array revisions to be shown in a pagenated list
* @see also https://www.dokuwiki.org/devel:changelog
*/
protected function getRevisions(&$first, &$hasNext)
{
@ -220,7 +221,18 @@ class Revisions extends Ui
// add current page or media as revision[0]
if ($this->media_id) {
$rev = filemtime(fullpath(mediaFN($this->media_id)));
$revisions[] = $changelog->getRevisionInfo($rev) + array(
$changelog->setChunkSize(1024);
$revinfo = $changelog->getRevisionInfo($rev) ?: array(
'date' => $rev,
'ip' => null,
'type' => null,
'id' => $this->media_id,
'user' => null,
'sum' => null,
'extra' => null,
'sizechange' => null,
);
$revisions[] = $revinfo + array(
'media' => true,
'current' => true,
);