From 2f363e8fa26ab849539e64ff7caa21bd164e8979 Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sat, 10 Nov 2018 21:43:24 +0100 Subject: sidebars-html-inserts --- w/class/art2.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'w/class/art2.php') diff --git a/w/class/art2.php b/w/class/art2.php index 970058b..867b17a 100644 --- a/w/class/art2.php +++ b/w/class/art2.php @@ -555,11 +555,21 @@ class Art2 public function settemplate($template) { if (is_string($template)) { - $template = json_decode($template, true); + $templatearray = json_decode($template, true); } if (is_array($template)) { - $this->template = $template; + $templatearray = $template; } + if(is_object($template)) { + $templatearray = (array) $template; + } + $this->template = array_map(function ($value) { + if(empty($value)) { + return null; + } else { + return $value; + } + }, $templatearray); } public function setaffcount($affcount) -- cgit v1.2.3