diff --git a/Block/Menu.php b/Block/Menu.php index 32bf8f9..1d8bc34 100644 --- a/Block/Menu.php +++ b/Block/Menu.php @@ -233,7 +233,7 @@ public function drawMainMenu() $this->extData[$ext->getCatId()] = $ext->getData(); } $last = count($categories); - $dropdownIds = explode(',', $this->_sysCfg->general['dropdown'] ?? ''); + $dropdownIds = explode(',', (string) $this->_sysCfg->general['dropdown']); $counter = 1; $this->removeChildrenWithoutActiveParent($categories, 0); foreach ($categories as $catTop){ @@ -451,7 +451,7 @@ private function getCategoryAsArray($category, $currentCategory, $isParentActive 'name' => $category->getName(), 'id' => 'category-node-' . $categoryId, 'url' => $this->_catalogCategory->getCategoryUrl($category), - 'has_active' => in_array((string)$categoryId, explode('/', (string)$currentCategory->getPath()), true), + 'has_active' => in_array((string)$categoryId, explode('/', (string) $currentCategory->getPath()), true), 'is_active' => $categoryId == $currentCategory->getId(), 'is_category' => true, 'is_parent_active' => $isParentActive, diff --git a/Controller/Adminhtml/Action.php b/Controller/Adminhtml/Action.php index 8c177be..71f85e0 100644 --- a/Controller/Adminhtml/Action.php +++ b/Controller/Adminhtml/Action.php @@ -88,8 +88,8 @@ public function __construct( protected function _isAllowed() { $namespace = (new \ReflectionObject($this))->getNamespaceName(); - $string = strtolower(str_replace(__NAMESPACE__ . '\\','', $namespace)); - $action = explode('\\', $string); + $string = strtolower(str_replace(__NAMESPACE__ . '\\','', (string) $namespace)); + $action = explode('\\', (string) $string); $action = array_shift($action); return $this->_authorization->isAllowed("Magiccart_Magicmenu::magicmenu_$action"); } diff --git a/Helper/Data.php b/Helper/Data.php index 28cf598..e5af49f 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -28,7 +28,7 @@ public function __construct( { parent::__construct($context); $this->moduleManager = $moduleManager; - $module = strtolower(str_replace('Magiccart_', '', $this->_getModuleName())); + $module = strtolower(str_replace('Magiccart_', '', (string) $this->_getModuleName())); $this->configModule = $this->getConfig($module); } @@ -43,7 +43,7 @@ public function getConfigModule($cfg='', $value=null) { $values = $this->configModule; if( !$cfg ) return $values; - $config = explode('/', $cfg); + $config = explode('/', (string) $cfg); $end = count($config) - 1; foreach ($config as $key => $vl) { if( isset($values[$vl]) ){ diff --git a/view/frontend/templates/aio-topmenu.phtml b/view/frontend/templates/aio-topmenu.phtml index 57730ff..f28c038 100644 --- a/view/frontend/templates/aio-topmenu.phtml +++ b/view/frontend/templates/aio-topmenu.phtml @@ -40,7 +40,7 @@ $drawExtraMenu = $menu['extraCat'] ? $extraHtml : ''; $vdrawExtraMenu = $vmenu['extraCat'] ? $extraHtml : ''; if($vmenu['mainCat']){ $vdesktop = $menuHtml['desktop']; - $vids = explode(',', $vmenu['notIncludeNav']); + $vids = explode(',', (string) $vmenu['notIncludeNav']); foreach ($vids as $id) { unset($vdesktop[$id]); } $vdrawMainMenu = implode("\n", $vdesktop); } @@ -71,7 +71,7 @@ $drawExtraMenu = $menu['extraCat'] ? $extraHtml : ''; drawMainMenu(); $mobileMenu = $menuHtml['mobile']; $desktop = $menuHtml['desktop']; -$ids = explode(',', $menu['notIncludeNav']); +$ids = explode(',', (string) $menu['notIncludeNav']); foreach ($ids as $id) { unset($desktop[$id]); } // drawHomeMenu $drawHomeMenu = $menu['home'] ? $this->drawHomeMenu() : ''; diff --git a/view/frontend/templates/vmenu.phtml b/view/frontend/templates/vmenu.phtml index 12ea987..b1f241b 100644 --- a/view/frontend/templates/vmenu.phtml +++ b/view/frontend/templates/vmenu.phtml @@ -18,7 +18,7 @@ if(!$vmenu['enabled']) return; $menuHtml = $this->drawMainMenu(); $mobileMenu = $menuHtml['mobile']; $desktop = $menuHtml['desktop']; -$ids = explode(',', $vmenu['notIncludeNav']); +$ids = explode(',', (string) $vmenu['notIncludeNav']); foreach ($ids as $id) { unset($desktop[$id]); } // drawHomeMenu $drawHomeMenu = $vmenu['home'] ? $this->drawHomeMenu() : '';