Commit 36cf4f4c authored by thomas craipeau's avatar thomas craipeau
Browse files

fix is_countable

parent 6d371886
<?php
include_once (Yii::get('module')->getModulePath()."/interop/.env.php");
include_once ("../.env.php");
/**
* ApiMediaWiki
*
......
......@@ -35,7 +35,7 @@ if (isset($this->dataView['error'])) {
if ($this->dataView['wiki']['params'] == "none") {
////////////TODO: ecrire code si pas trouver de categories
} else {
$count = count($this->dataView['wiki']['params']);
$count = is_countable($this->dataView['wiki']['params']) ? count($this->dataView['wiki']['params']) : 0;
$xsParam = 6;
if ($count > 2) {
$xsParam = 3;
......
......@@ -20,7 +20,7 @@ HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule, Yii::get('modul
<h4 id="title-menu" class=" text-red"><?= strtoupper($this->dataView['categorie']) ?></h4>
<ul class="subMenu col-xs-12 no-padding">
<?php
if (count($this->dataView['menu']) > 30) {
if ((is_countable($this->dataView['menu']) ? count($this->dataView['menu']) : 0) > 30) {
$menuSort = [];
foreach ($this->dataView['menu'] as $k => $v) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment