diff --git a/classes/db/queryparts/Query.class.php b/classes/db/queryparts/Query.class.php index 405f17f3d4..87759656a8 100644 --- a/classes/db/queryparts/Query.class.php +++ b/classes/db/queryparts/Query.class.php @@ -144,7 +144,7 @@ function setPriority($priority) function setColumnList($columnList) { $this->columnList = $columnList; - if(count($this->columnList) > 0) + if(is_array($this->columnList) && count($this->columnList) > 0) { $selectColumns = array(); $dbParser = DB::getParser(); @@ -161,7 +161,7 @@ function setColumnList($columnList) function setColumns($columns) { - if(!isset($columns) || count($columns) === 0) + if(!isset($columns) || (is_array($columns) && count($columns) === 0)) { $this->columns = array(new StarExpression()); return; @@ -177,7 +177,7 @@ function setColumns($columns) function setTables($tables) { - if(!isset($tables) || count($tables) === 0) + if(!isset($tables) || (is_array($tables) && count($tables) === 0)) { $this->setError(TRUE); $this->setMessage("You must provide at least one table for the query."); @@ -200,7 +200,7 @@ function setSubquery($subquery) function setConditions($conditions) { $this->conditions = array(); - if(!isset($conditions) || count($conditions) === 0) + if(!isset($conditions) || (is_array($conditions) && count($conditions) === 0)) { return; } @@ -220,7 +220,7 @@ function setConditions($conditions) function setGroups($groups) { - if(!isset($groups) || count($groups) === 0) + if(!isset($groups) || (is_array($groups) && count($groups) === 0)) { return; } @@ -234,7 +234,7 @@ function setGroups($groups) function setOrder($order) { - if(!isset($order) || count($order) === 0) + if(!isset($order) || (is_array($order) && count($order) === 0)) { return; } @@ -560,7 +560,7 @@ function getOrderByString() { if(!$this->_orderByString) { - if(count($this->orderby) === 0) + if(!is_array($this->orderby) || count($this->orderby) === 0) { return ''; } @@ -587,7 +587,7 @@ function getLimit() function getLimitString() { $limit = ''; - if(count($this->limit) > 0) + if($this->limit) { $limit = ''; $limit .= $this->limit->toString(); @@ -611,7 +611,7 @@ function getArguments() $this->arguments = array(); // Join table arguments - if(count($this->tables) > 0) + if(is_array($this->tables) && count($this->tables) > 0) { foreach($this->tables as $table) { @@ -628,7 +628,7 @@ function getArguments() // Column arguments // The if is for delete statements, all others must have columns - if(count($this->columns) > 0) + if(is_array($this->columns) && count($this->columns) > 0) { foreach($this->columns as $column) { @@ -644,7 +644,7 @@ function getArguments() } // Condition arguments - if(count($this->conditions) > 0) + if(is_array($this->conditions) && count($this->conditions) > 0) { foreach($this->conditions as $conditionGroup) { @@ -657,7 +657,7 @@ function getArguments() } // Navigation arguments - if(count($this->orderby) > 0) + if(is_array($this->orderby) && count($this->orderby) > 0) { foreach($this->orderby as $order) { diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index 0081f0f9ca..a7cbe9e0a4 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -923,7 +923,7 @@ function _setInputErrorToContext() { Context::set('XE_VALIDATOR_ID', $_SESSION['XE_VALIDATOR_ID']); } - if(count($_SESSION['INPUT_ERROR'])) + if(is_array($_SESSION['INPUT_ERROR']) && count($_SESSION['INPUT_ERROR'])) { Context::set('INPUT_ERROR', $_SESSION['INPUT_ERROR']); } diff --git a/modules/module/module.model.php b/modules/module/module.model.php index dabdeb01fb..8258704510 100644 --- a/modules/module/module.model.php +++ b/modules/module/module.model.php @@ -480,7 +480,7 @@ function addModuleExtraVars($module_info) foreach($target_module_info as $key => $val) { - if(!$extra_vars[$val->module_srl] || !count($extra_vars[$val->module_srl])) continue; + if(!$extra_vars[$val->module_srl] || !count(get_object_vars($extra_vars[$val->module_srl]))) continue; foreach($extra_vars[$val->module_srl] as $k => $v) { if($target_module_info[$key]->{$k}) continue; @@ -1782,7 +1782,7 @@ function getModuleExtraVars($list_module_srl) if(!$output->toBool()) { - return; + return array(); } if(!$output->data)