From 58e4580c81b0e50557a7e9ce8391d3b45bd10d6c Mon Sep 17 00:00:00 2001 From: Antoine Le Gonidec Date: Fri, 4 Oct 2024 19:19:43 +0200 Subject: [PATCH] Prevent PHP warnings due to trying to fetch unset array entries --- helper.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/helper.php b/helper.php index 721422e..c6a9d0c 100644 --- a/helper.php +++ b/helper.php @@ -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; } /**