diff options
Diffstat (limited to 'w/class/art2.php')
-rw-r--r-- | w/class/art2.php | 14 |
1 files changed, 12 insertions, 2 deletions
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) |