Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions classes/db/queryparts/Query.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand All @@ -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.");
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -560,7 +560,7 @@ function getOrderByString()
{
if(!$this->_orderByString)
{
if(count($this->orderby) === 0)
if(!is_array($this->orderby) || count($this->orderby) === 0)
{
return '';
}
Expand All @@ -587,7 +587,7 @@ function getLimit()
function getLimitString()
{
$limit = '';
if(count($this->limit) > 0)
if($this->limit)
{
$limit = '';
$limit .= $this->limit->toString();
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand All @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion classes/module/ModuleHandler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}
Expand Down
4 changes: 2 additions & 2 deletions modules/module/module.model.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1782,7 +1782,7 @@ function getModuleExtraVars($list_module_srl)

if(!$output->toBool())
{
return;
return array();
}

if(!$output->data)
Expand Down