Prevent PHP warnings due to trying to fetch unset array entries

This commit is contained in:
Antoine Le Gonidec 2024-10-04 19:19:43 +02:00
parent 198c0ba490
commit 58e4580c81
Signed by: vv221
GPG key ID: 636B78F91CEB80D8

View file

@ -131,7 +131,8 @@ class helper_plugin_semantic extends DokuWiki_Plugin
*/
public function getAuthor()
{
return ($this->meta['creator'] ? $this->meta['creator'] : null);
return ( array_key_exists('creator', $this->meta ) ?
$this->meta['creator'] : null;
}
/**
@ -141,7 +142,8 @@ class helper_plugin_semantic extends DokuWiki_Plugin
*/
public function getAuthorID()
{
return ($this->meta['user'] ? $this->meta['user'] : null);
return ( array_key_exists('user', $this->meta ) ?
$this->meta['user'] : null;
}
/**