From 137514370e4ed39447fdbee3544b0607565f3853 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..01147b7 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; } /**