Fix undefined array keys when displaying revisions

This commit is contained in:
Damien Regad 2021-01-27 02:17:16 +01:00
parent 7c3926398e
commit 3fef852d67
2 changed files with 10 additions and 3 deletions

View File

@ -107,7 +107,7 @@ class InputElement extends Element
$name = array_keys($parsed);
$name = array_shift($name);
if (is_array($parsed[$name])) {
if (isset($parsed[$name]) && is_array($parsed[$name])) {
$key = array_keys($parsed[$name]);
$key = array_shift($key);
} else {

View File

@ -237,15 +237,22 @@ class Revisions extends Ui
'current' => true,
);
} else {
if (isset($INFO['meta']['last_change'])) {
$type = $INFO['meta']['last_change']['type'];
$sizechange = $INFO['meta']['last_change']['sizechange'];
} else {
$type = $sizechange = null;
}
$revisions[] = array(
'date' => $INFO['lastmod'],
'ip' => null,
'type' => $INFO['meta']['last_change']['type'],
'type' => $type,
'id' => $INFO['id'],
'user' => $INFO['editor'],
'sum' => $INFO['sum'],
'extra' => null,
'sizechange' => $INFO['meta']['last_change']['sizechange'],
'sizechange' => $sizechange,
'current' => true,
);
}