From c4e1e5d72436d2a1ffacccc92d002d4ded4b553c Mon Sep 17 00:00:00 2001 From: Romain Cazier Date: Mon, 10 Apr 2023 23:02:59 +0200 Subject: [PATCH] Fix issue where $field was sent instead of $options, resulting in an error with array_merge --- TextformatterFootnotes.info.php | 2 +- TextformatterFootnotes.module.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/TextformatterFootnotes.info.php b/TextformatterFootnotes.info.php index 9037bbe..e12190c 100644 --- a/TextformatterFootnotes.info.php +++ b/TextformatterFootnotes.info.php @@ -2,7 +2,7 @@ $info = [ "title" => "Footnotes", - "version" => "0.0.2", + "version" => "0.0.3", "summary" => "Adds footnotes using Markdown Extra’s syntax, minus Markdown", "author" => "EPRC", "href" => "https://github.com/eprcstudio/TextformatterFootnotes", diff --git a/TextformatterFootnotes.module.php b/TextformatterFootnotes.module.php index 8219220..8b1a269 100644 --- a/TextformatterFootnotes.module.php +++ b/TextformatterFootnotes.module.php @@ -41,7 +41,7 @@ public function format(&$str) { } public function formatValue(Page $page, Field $field, &$value) { - $value = $this->addFootnotes($value, $field); + $value = $this->addFootnotes($value, [], $field); } /** @@ -72,6 +72,7 @@ public function formatValue(Page $page, Field $field, &$value) { */ public function ___addFootnotes($str, $options = [], $field = "") { if(!$str) return ""; + if(!is_array($options)) $options = []; $defaultOptions = [ "tag" => "div", "icon" => $this->icon,