array goes stdClass

This commit is contained in:
Jean-Christian Denis 2022-12-13 22:16:38 +01:00
parent d60b2c10ce
commit 8b112f8fec
Signed by: JcDenis
GPG key ID: 1B5B8C5B90B6C951

View file

@ -110,29 +110,29 @@ abstract class epcFilter
{
$opt = json_decode((string) dcCore::app()->blog->settings->__get(basename(dirname('../' . __DIR__)))->__get($this->id));
if (!is_array($opt)) {
if (empty($opt)) {
$opt = [];
}
if (isset($opt['nocase'])) {
$this->settings['nocase'] = (bool) $opt['nocase'];
if (isset($opt->nocase)) {
$this->settings['nocase'] = (bool) $opt->nocase;
}
if (isset($opt['plural'])) {
$this->settings['plural'] = (bool) $opt['plural'];
if (isset($opt->plural)) {
$this->settings['plural'] = (bool) $opt->plural;
}
if (isset($opt['limit'])) {
$this->settings['limit'] = abs((int) $opt['limit']);
if (isset($opt->limit)) {
$this->settings['limit'] = abs((int) $opt->limit);
}
if (isset($opt['style']) && is_array($opt['style'])) {
$this->settings['style'] = (array) $opt['style'];
if (isset($opt->style) && is_array($opt->style)) {
$this->settings['style'] = (array) $opt->style;
}
if (isset($opt['notag'])) {
$this->settings['notag'] = (string) $opt['notag'];
if (isset($opt->notag)) {
$this->settings['notag'] = (string) $opt->notag;
}
if (isset($opt['tplValues'])) {
$this->settings['tplValues'] = (array) $opt['tplValues'];
if (isset($opt->tplValues)) {
$this->settings['tplValues'] = (array) $opt->tplValues;
}
if (isset($opt['pubPages'])) {
$this->settings['pubPages'] = (array) $opt['pubPages'];
if (isset($opt->pubPages)) {
$this->settings['pubPages'] = (array) $opt->pubPages;
}
}