diff options
author | vincent-peugnet <v.peugnet@free.fr> | 2018-11-10 21:43:24 +0100 |
---|---|---|
committer | vincent-peugnet <v.peugnet@free.fr> | 2018-11-10 21:43:24 +0100 |
commit | 2f363e8fa26ab849539e64ff7caa21bd164e8979 (patch) | |
tree | 238f2689e44bfc26329f970ced4c678b1ab6818d /w/class/art2.php | |
parent | 687b1f851abbb28750d2921d4f5beaac24b3249d (diff) | |
download | wcms-2f363e8fa26ab849539e64ff7caa21bd164e8979.tar.gz wcms-2f363e8fa26ab849539e64ff7caa21bd164e8979.zip |
sidebars-html-inserts
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) |